-
Notifications
You must be signed in to change notification settings - Fork 237
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
Provide package_dir
for setting subdirectory of project
#295
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,12 @@ def build(options: BuildOptions): | |
('pp', 'manylinux_x86_64', options.manylinux_images['pypy_x86_64']), | ||
] | ||
|
||
abs_project_dir = os.path.abspath(options.project_dir) | ||
abs_package_dir = os.path.abspath(options.package_dir) | ||
|
||
container_project_dir = '/project' | ||
container_package_dir = os.path.join(container_project_dir, os.path.relpath(abs_package_dir, os.path.commonprefix([abs_project_dir, abs_package_dir]))), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, it should be possible to pass There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not if package_dir was passed as absolute path, I guess? Or, in that case we'd need to specify it needs to be a relative path? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah yeah, good point. Then the relpath step would still be needed, but it could be left relative to the working dir and used like that inside the container. |
||
|
||
for implementation, platform_tag, docker_image in platforms: | ||
platform_configs = [c for c in python_configurations if c.identifier.startswith(implementation) and c.identifier.endswith(platform_tag)] | ||
if not platform_configs: | ||
|
@@ -165,7 +171,7 @@ def build(options: BuildOptions): | |
# Build the wheel | ||
rm -rf /tmp/built_wheel | ||
mkdir /tmp/built_wheel | ||
pip wheel . -w /tmp/built_wheel --no-deps {build_verbosity_flag} | ||
pip wheel {package_dir} -w /tmp/built_wheel --no-deps {build_verbosity_flag} | ||
built_wheel=(/tmp/built_wheel/*.whl) | ||
|
||
# repair the wheel | ||
|
@@ -234,6 +240,7 @@ def build(options: BuildOptions): | |
done | ||
'''.format( | ||
config_python_bin=config.path + '/bin', | ||
package_dir=container_package_dir, | ||
test_requires=' '.join(options.test_requires), | ||
test_extras=options.test_extras, | ||
test_command=shlex.quote( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about calling
os.getcwd()
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even better: killing the
project_dir
parameter, and just callingos.getcwd()
inlinux.py
/macos.py
/windows.py
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left
project_dir
because it still allows a bit advanced configuration if needed. But I can update it toos.getcwd()
.