Skip to content

Commit

Permalink
Fetch script instead, also fix path to env.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
natefoo committed Nov 29, 2023
1 parent c08b1ac commit 40ac0f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions recipes/pysam/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ name: pysam
version: 0.22.0
# as of 0.22.0 {project} in pyproject.toml [tool.cibuildwheel] expects to be the package dir
run_in_sdist: true
run_in_sdist_before:
- curl -Lo htslib/hts_probe_cc.sh 'https://raw.githubusercontent.com/pysam-developers/pysam/v0.22.0/htslib/hts_probe_cc.sh'
- chmod +x htslib/hts_probe_cc.sh
6 changes: 3 additions & 3 deletions wheel_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
package_version = meta["version"]
is_package_pure = meta.get("purepy", False)
run_in_sdist = meta.get("run_in_sdist", False)
run_in_sdist_before = meta.get("run_in_sdist_before", [])

# Find the sdist url using the PyPI warehouse API https://warehouse.pypa.io/api-reference/json.html
pypi_url = f"https://pypi.org/pypi/{package_name}/{package_version}/json"
Expand Down Expand Up @@ -58,7 +59,7 @@
# Generate the commands to run
check_commands = []
commands = []
env_file = os.path.join(folder, "env.sh")
env_file = os.path.join(os.getcwd(), folder, "env.sh")
if os.path.exists(env_file):
commands.append(f". '{env_file}'")

Expand All @@ -84,8 +85,7 @@
check_commands.append("cibuildwheel --print-build-identifiers")
if run_in_sdist:
commands.append(f"cd '{extracted_sdist_dir}'")
# FIXME: testing
commands.append("sed -i 's/^before-build.*//' pyproject.toml")
commands.extend(run_in_sdist_before)
commands.append(f"cibuildwheel --output-dir '{wheelhouse}' '{package_path}'")
joined_command = " && ".join(commands)
joined_check_command = " && ".join(check_commands)
Expand Down

0 comments on commit 40ac0f5

Please sign in to comment.