-
Notifications
You must be signed in to change notification settings - Fork 343
feat: Include waved binary in Conda distributions #2266 #2303
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
base: main
Are you sure you want to change the base?
Changes from all commits
5ad4eec
64d7754
3bd4f6a
5ac9916
29c8c50
104a074
ec440f4
e05d411
f4ec2f9
03c8e48
b417bac
5e2fed3
de74e91
a9e3937
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 |
---|---|---|
@@ -1,3 +1,19 @@ | ||
build_conda_package = \ | ||
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. Is it possible to create 2 separate make targets (conda-noarch and conda-arch) instead? And maybe a 3rd one for moving stuff around (the last section of the function) |
||
if [ "$(1)" != "noarch" ]; then \ | ||
mkdir -p conda/temp; \ | ||
cp -a ../../build/wave-$(VERSION)-$(1)/. conda/temp; \ | ||
NO_ARCH=0 conda build --output-folder temp_build/ conda; \ | ||
find temp_build/ -name *.tar.bz2 | while read -r file; do \ | ||
conda convert --force --platform $(2) "$$file" -o temp_build/; \ | ||
done \ | ||
fi && \ | ||
if [ "$(1)" == "noarch" ]; then \ | ||
NO_ARCH=1 conda build --output-folder temp_build/ conda; \ | ||
fi && \ | ||
mkdir -p sdist/$(2) && \ | ||
mv temp_build/$(2)/*.tar.bz2 sdist/$(2) && \ | ||
rm -rf temp_build conda/temp | ||
|
||
.PHONY: build | ||
build: purge | ||
H2O_WAVE_PLATFORM=win_amd64 ../venv/bin/python3 -m build --wheel | ||
|
@@ -6,7 +22,11 @@ build: purge | |
H2O_WAVE_PLATFORM=macosx_11_0_arm64 ../venv/bin/python3 -m build --wheel | ||
H2O_WAVE_PLATFORM=macosx_12_0_arm64 ../venv/bin/python3 -m build --wheel | ||
../venv/bin/python3 -m build --wheel | ||
$(call build_conda_package,darwin-arm64,osx-arm64) | ||
$(call build_conda_package,darwin-amd64,osx-64) | ||
$(call build_conda_package,linux-amd64,linux-64) | ||
$(call build_conda_package,windows-amd64,win-64) | ||
$(call build_conda_package,noarch,noarch) | ||
|
||
purge: ## Purge previous build | ||
rm -f h2o_wave/metadata.py | ||
rm -rf build dist h2o_wave.egg-info | ||
rm -rf build dist sdist h2o_wave.egg-info temp_build conda/temp h2o_wave/metadata.py |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# TODO: Build a single package for all python versions once this is resolved: https://github.com/conda/conda-build/issues/2611#issuecomment-1239338538 | ||
python_version: | ||
- 3.8 | ||
- 3.9 | ||
- 3.10 | ||
- 3.11 | ||
- 3.12 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,10 @@ def initialize(self, _version, build_data): | |
if not platform: | ||
# Create a default metadata file in case of noarch builds. | ||
create_metadata_file('linux', 'amd64') | ||
# If conda build, copy binaries into package. | ||
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. I though conda has its own build pipeline and doesn't use hatch. How does this work? |
||
binaries_path = os.path.join('conda', 'temp') | ||
if os.environ.get('CONDA_BUILD') and os.path.exists(binaries_path): | ||
self.copy_binaries_into_package(binaries_path) | ||
return | ||
|
||
build_data['tag'] = f'py3-none-{platform}' | ||
|
@@ -42,12 +46,7 @@ def initialize(self, _version, build_data): | |
elif platform == 'manylinux1_x86_64': | ||
operating_system = 'linux' | ||
|
||
binaries_path = os.path.join('..', '..', 'build', f'wave-{version}-{operating_system}-{arch}') | ||
if not os.path.exists(binaries_path): | ||
raise Exception(f'{binaries_path} does not exist. Run make release first to generate server binaries.') | ||
|
||
self.copy_files(binaries_path, 'tmp', ['demo', 'examples', 'test']) | ||
self.copy_files('project_templates', 'tmp', [], True) | ||
self.copy_binaries_into_package(os.path.join('..', '..', 'build', f'wave-{version}-{operating_system}-{arch}')) | ||
|
||
create_metadata_file(operating_system, arch) | ||
|
||
|
@@ -61,5 +60,13 @@ def copy_files(self, src, dst, ignore, keep_dir=False) -> None: | |
elif os.path.isdir(src_file) and file_name not in ignore: | ||
self.copy_files(src_file, dst_file, ignore) | ||
|
||
def copy_binaries_into_package(self, binaries_path): | ||
if not os.path.exists(binaries_path): | ||
raise Exception(f'{binaries_path} does not exist. Run make release first to generate server binaries.') | ||
|
||
self.copy_files(binaries_path, 'tmp', ['demo', 'examples', 'test']) | ||
self.copy_files('project_templates', 'tmp', [], True) | ||
|
||
def finalize(self, version: str, build_data: Dict[str, Any], artifact_path: str) -> None: | ||
shutil.rmtree('tmp', ignore_errors=True) | ||
|
Uh oh!
There was an error while loading. Please reload this page.