Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import bug: missing script/batt.py when installing llfs in downstream package. #136

Merged
merged 5 commits into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 14 additions & 25 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@

import os, sys, platform

VERBOSE = os.getenv('VERBOSE') and True or False
gabrielbornstein marked this conversation as resolved.
Show resolved Hide resolved

#==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - -
# Import batt helper utilities module.
#
sys.path.append(os.path.join(os.path.dirname(__file__), 'script'))
import batt
#
#+++++++++++-+-+--+----- --- -- - - - -


class LlfsConan(ConanFile):
Expand All @@ -27,31 +34,20 @@ class LlfsConan(ConanFile):
default_options = {"shared": False}
build_policy = "missing"

exports = [
"script/*.py",
"script/*.sh",
]
exports_sources = [
"src/CMakeLists.txt",
"src/**/*.hpp",
"src/**/*.ipp",
"src/**/*.cpp",
"script/*.py",
"script/*.sh",
]

#+++++++++++-+-+--+----- --- -- - - - -
def _append_script_dir(self):
script_dir1 = os.path.join(os.path.dirname(__file__), 'script')
sys.path.append(script_dir1)

try:
script_dir2 = os.path.join(os.path.split(self.source_folder)[0], 'script')
sys.path.append(script_dir2)
except:
pass

#+++++++++++-+-+--+----- --- -- - - - -

def set_version(self):
self._append_script_dir()
import batt
batt.VERBOSE = VERBOSE
gabrielbornstein marked this conversation as resolved.
Show resolved Hide resolved
self.version = batt.get_version(no_check_conan=True)
batt.verbose(f'VERSION={self.version}')

Expand Down Expand Up @@ -85,8 +81,6 @@ def requirements(self):
transitive_headers=True,
transitive_libs=True)

self._append_script_dir()
import batt
batt.conanfile_requirements(self, deps, override_deps, platform_deps)


Expand All @@ -97,13 +91,8 @@ def layout(self):
def generate(self):
tc = CMakeToolchain(self)
tc.generate()

deps = CMakeDeps(self)
deps.generate()

self._append_script_dir()
import batt
batt.VERBOSE = VERBOSE
batt.generate_conan_find_requirements(self)


Expand All @@ -117,7 +106,7 @@ def configure(self):

def build(self):
cmake = CMake(self)
cmake.verbose = VERBOSE
cmake.verbose = batt.VERBOSE
cmake.configure()
cmake.build()

Expand Down