Skip to content

Conversation

rbebb
Copy link
Contributor

@rbebb rbebb commented Oct 23, 2024

This updates Shapely to the latest version! Please let me know if I missed any steps!

Closes #1269

@rbebb rbebb changed the title Update Shapely to 2.0.6 #1269 Update Shapely to 2.0.6 Oct 23, 2024
@rbebb rbebb changed the title #1269 Update Shapely to 2.0.6 Update Shapely to 2.0.6 Oct 23, 2024
@mhsmith
Copy link
Member

mhsmith commented Oct 23, 2024

I think the main step you missed was to actually test your changes. cython doesn't have a version number, so there's no way this recipe could work.

The build-wheel tool now installs build-system requirements from pyproject.toml files, so in many cases the cython requirements can now be removed from the meta.yaml files.

Also, unless there's a specific reason, which should be explained with a comment, the NumPy versions should follow the same pattern as the other packages that use it, such as Pandas and Matplotlib.

@rbebb
Copy link
Contributor Author

rbebb commented Nov 4, 2024

I had updated numpy since there's a more up-to-date copy available in the Chaquopy package index. I can revert that change though!

- Revert numpy version change
- Remove build requirements now that the build-wheel tool can install build-system requirements from a pyproject.toml file
@rbebb
Copy link
Contributor Author

rbebb commented Nov 4, 2024

@mhsmith, updated the PR. I reverted the numpy change and removed the cython requirement.

@mhsmith
Copy link
Member

mhsmith commented Nov 9, 2024

I had updated numpy since there's a more up-to-date copy available in the Chaquopy package index

Building against a library at compile time means that you must use that version or newer at runtime. So to give as much flexibility as possible, it's better to build against older versions where feasible.

@mhsmith
Copy link
Member

mhsmith commented Nov 9, 2024

@mhsmith, updated the PR. I reverted the numpy change and removed the cython requirement.

The build still doesn't work, because the patch doesn't apply to the new version:

(pypi) smith@chaquo:~/git/chaquo/chaquopy/server/pypi$ ./build-wheel.py --python 3.8 --abi arm64-v8a shapely
build-wheel: mkdir -p /home/smith/git/chaquo/chaquopy/server/pypi/packages/shapely/build/2.0.6
build-wheel: cd /home/smith/git/chaquo/chaquopy/server/pypi/packages/shapely/build/2.0.6
build-wheel: mkdir -p /home/smith/git/chaquo/chaquopy/server/pypi/packages/shapely/build/2.0.6/cp38-cp38-android_24_arm64_v8a
build-wheel: Searching PyPI
/home/smith/.venv/pypi/lib/python3.8/site-packages/pypi_simple/classes.py:275: UnexpectedRepoVersionWarning: Repository's version (1.3) has greater minor component than supported version (1.1)
  page = RepositoryPage.from_html(html, base_url, from_encoding)
build-wheel: Downloading https://files.pythonhosted.org/packages/4a/89/0d20bac88016be35ff7d3c0c2ae64b477908f1b1dfa540c5d69ac7af07fe/shapely-2.0.6.tar.gz
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 276k/276k [00:00<00:00, 5.77MB/s]
build-wheel: tar -C /tmp/build-wheel-s2375jd4 -xf Shapely-2.0.6.tar.gz
build-wheel: mv /tmp/build-wheel-s2375jd4/shapely-2.0.6 /home/smith/git/chaquo/chaquopy/server/pypi/packages/shapely/build/2.0.6/cp38-cp38-android_24_arm64_v8a/src
build-wheel: rm -rf /tmp/build-wheel-s2375jd4
build-wheel: cd /home/smith/git/chaquo/chaquopy/server/pypi/packages/shapely/build/2.0.6/cp38-cp38-android_24_arm64_v8a/src
build-wheel: patch -p1 -i /home/smith/git/chaquo/chaquopy/server/pypi/packages/shapely/patches/chaquopy.patch
patching file setup.py
Hunk #1 FAILED at 135.
Hunk #2 FAILED at 251.
Hunk #3 FAILED at 320.
Hunk #4 FAILED at 337.
Hunk #5 FAILED at 358.
Hunk #6 FAILED at 382.
6 out of 6 hunks FAILED -- saving rejects to file setup.py.rej
build-wheel: Error: Command '['patch', '-p1', '-i', '/home/smith/git/chaquo/chaquopy/server/pypi/packages/shapely/patches/chaquopy.patch']' returned non-zero exit status 1.

In all GitHub projects, you are expected to test PRs before submitting them. Please follow the instructions in server/pypi/README.md to build and test the new Shapely version, and update the recipe as necessary. You don't have to cover all combinations of Python version and ABI, but you do have to get at least one working, and let me know what it was.

@mhsmith mhsmith marked this pull request as draft January 26, 2025 20:00
@rbebb rbebb changed the title Update Shapely to 2.0.6 Update Shapely to 2.0.7 Apr 5, 2025
@rbebb
Copy link
Contributor Author

rbebb commented Apr 5, 2025

@mhsmith I pushed updates that change the Shapely version to 2.0.7 and update the patch file. I think I am on the right track because it appears to build, but I see the output below once it's done.

Command used to build:

./build-wheel.py --python 3.8 --abi arm64-v8a shapely

Error in output:

build-wheel: Error: /home/user/Dev/chaquopy/server/pypi/packages/shapely/build/2.0.7/cp38-cp38-android_24_arm64_v8a/fix_wheel/Shapely-2.0.7.dist-info does not exist

@rbebb
Copy link
Contributor Author

rbebb commented Apr 7, 2025

I should also add that while I have been trying to build with 3.8 (due to chaquopy-geos only being available for Python 3.8.1), the goal is to get Python 3.11 support. I'll create a PR for chaquopy-geos to add support for multiple Python versions.

@rbebb
Copy link
Contributor Author

rbebb commented Apr 7, 2025

Created the PR to update chaquopy-geos here: #1357

@mhsmith
Copy link
Member

mhsmith commented Apr 20, 2025

while I have been trying to build with 3.8 (due to chaquopy-geos only being available for Python 3.8.1), the goal is to get Python 3.11 support

As noted in #1357, chaquopy-geos is not a Python package, so it should be possible to share one version of chaquopy-geos between all versions of Python. The similarity in the version numbers is a coincidence.

build-wheel: Error: /home/user/Dev/chaquopy/server/pypi/packages/shapely/build/2.0.7/cp38-cp38-android_24_arm64_v8a/fix_wheel/Shapely-2.0.7.dist-info does not exist

This error usually indicates that meta.yaml disagrees with the package itself about one of the following:

  • The package's version number
  • The spelling, punctuation or capitalization of the package's name

You can find out more by looking in the fix_wheel directory and seeing what dist-info directory does exist. If it shows a default version number like 0.0.1, then this probably means the package was unable to determine its own version number, perhaps because of a missing build-time package like setuptools-scm.

If you need more help, please save the entire build-wheel output to a file, and attach it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Update Shapely
2 participants