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

python311Packages.shapely: 2.0.1 → 2.0.2 #263989

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Oct 28, 2023

Description of changes

https://github.com/shapely/shapely/releases/tag/2.0.2

The tests were moved to shapely/ directory so we cannot just remove it.

Blocks geos bump: #240229

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@jtojnar jtojnar mentioned this pull request Oct 28, 2023
12 tasks
@@ -45,7 +45,10 @@ buildPythonPackage rec {
];

preCheck = ''
rm -r shapely # prevent import of local shapely
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ugly but without it, test collection fails because it will try to load shapely from the project directory:

============================= test session starts ==============================
platform linux -- Python 3.11.5, pytest-7.4.2, pluggy-1.2.0
rootdir: /build/shapely-2.0.2
configfile: setup.cfg
collected 0 items / 1 error                                                    

==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
/nix/store/lhjsx27ijd31l8qgxkv5rv1z0c3hs7pn-python3.11-pytest-7.4.2/lib/python3.11/site-packages/_pytest/config/__init__.py:641: in _importconftest
    mod = import_path(conftestpath, mode=importmode, root=rootpath)
/nix/store/lhjsx27ijd31l8qgxkv5rv1z0c3hs7pn-python3.11-pytest-7.4.2/lib/python3.11/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1126: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1126: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1126: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:940: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
shapely/__init__.py:1: in <module>
    from shapely.lib import GEOSException  # NOQA
E   ModuleNotFoundError: No module named 'shapely.lib'
=========================== short test summary info ============================
ERROR  - ModuleNotFoundError: No module named 'shapely.lib'
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.08s ===============================

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is related to this issue, #255262.
Changing the current directory is one of the workarounds.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that cd $out works but decided against it because then it would run tests installed to $out and I am not sure all tests are installed (and if they should be).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the main investigator of #255262, I personally prefer cd $out - if we suspect upstream doesn't install all tests, perhaps we can check that by listing what gets installed in the package vs what's in the source? I doubt upstream won't install either all of none.

In any case, a link to #255262 near the workaround (which ever you'd eventually choose) would be great.

@natsukium
Copy link
Member

@ofborg build python311Packages.shapely

Copy link
Contributor

@imincik imincik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Version bump and tests workaround looks good to me.

Copy link
Contributor

@imincik imincik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the main investigator of #255262, I personally prefer cd $out - if we suspect upstream doesn't install all tests, perhaps we can check that by listing what gets installed in the package vs what's in the source? I doubt upstream won't install either all of none.

In any case, a link to #255262 near the workaround (which ever you'd eventually choose) would be great.

I prefer cd $out as well. Current cp workaround might in theory prevent losing some test, but I wouldn't go this way until we know that this can happen.

https://github.com/shapely/shapely/releases/tag/2.0.2

The tests were moved to shapely/ directory so we cannot just remove it.
@doronbehar doronbehar changed the title python3.pkgs.shapely: 2.0.1 → 2.0.2 python311Packages.shapely: 2.0.1 → 2.0.2 Nov 17, 2023
@doronbehar
Copy link
Contributor

Since more people expressed their support for cd $out vs the last implementation, I pushed a simple preCheck hook, along with a link to #255262 , which also includes a link to this PR as well.

@ofborg ofborg bot requested review from imincik and sikmir November 17, 2023 13:02
Copy link
Contributor

@imincik imincik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good.

@doronbehar doronbehar merged commit 3dda68e into NixOS:master Nov 17, 2023
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants