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

Dependencies not installed when installing v3.2.0 from PyPI #97

Closed
hakonanes opened this issue Sep 2, 2024 · 7 comments · Fixed by #98
Closed

Dependencies not installed when installing v3.2.0 from PyPI #97

hakonanes opened this issue Sep 2, 2024 · 7 comments · Fixed by #98

Comments

@hakonanes
Copy link
Contributor

Hi all!

Installing diffpy.structure v3.2.0 from PyPI into a Python 3.11.9 environment with

pip install diffpy.structure

and running

>>> from diffpy.structure import loadStructure

raises

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/diffpy/lib/python3.11/site-packages/diffpy/structure/__init__.py", line 40, in <module>
    from diffpy.structure.atom import Atom
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/diffpy/lib/python3.11/site-packages/diffpy/structure/atom.py", line 20, in <module>
    import numpy
ModuleNotFoundError: No module named 'numpy'

Looking at my fresh environment

> pip list
Package          Version
---------------- -------
diffpy.structure 3.2.0
pip              24.2
setuptools       72.2.0
wheel            0.44.0

🤔 ... it is rather bare. Should I not get the dependencies when installing from PyPI? This is what I'd expect. It seems to me like you can include NumPy and PyCIFRW as core dependencies in your pyproject.toml file?

As a maintainer of a package depending on diffpy.structure for CIF reading, this means that we now have to list PyCIFRW as a dependency when using diffpy.structure.parsers.p_cif, while before we only had to list diffpy.structure.

@sbillinge
Copy link
Contributor

Thanks for this @hakonanes, they should install. We will take a look.

We have been restructuring our packages to make them consistent and have introduced some bugs out seems. Our apologies. Thanks for posting the bug.

@sbillinge
Copy link
Contributor

We will try and push out a fix today.

@sbillinge
Copy link
Contributor

closed by a related PR, but reopening because it is not tested.

@sbillinge sbillinge reopened this Sep 3, 2024
@sbillinge
Copy link
Contributor

@hakonanes I pushed a new release-candidate to pypi. Please can you test that it works for you? It is a pre-release so you will only get it if you pin the dependency to diffpy.structure==3.2.1rc1

If this works then I will make a full release of 3.2.1 which you would then get with pip install diffpy.structure as usual.

@hakonanes
Copy link
Contributor Author

Hi @sbillinge and team, it works! Thanks for the speedy fixing :)

Extending my environment from above:

$ pip list
Package          Version
---------------- -------
diffpy.structure 3.2.0
pip              24.2
setuptools       72.2.0
wheel            0.44.0

$ pip install diffpy.structure==3.2.1rc1
Collecting diffpy.structure==3.2.1rc1
  Downloading diffpy_structure-3.2.1rc1.tar.gz (98 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting numpy<2.0.0 (from diffpy.structure==3.2.1rc1)
  Using cached numpy-1.26.4-cp311-cp311-macosx_11_0_arm64.whl.metadata (114 kB)
Collecting pycifrw (from diffpy.structure==3.2.1rc1)
  Using cached PyCifRW-4.4.6-cp311-cp311-macosx_11_0_arm64.whl
Collecting ply (from pycifrw->diffpy.structure==3.2.1rc1)
  Using cached ply-3.11-py2.py3-none-any.whl.metadata (844 bytes)
Using cached numpy-1.26.4-cp311-cp311-macosx_11_0_arm64.whl (14.0 MB)
Using cached ply-3.11-py2.py3-none-any.whl (49 kB)
Building wheels for collected packages: diffpy.structure
  Building wheel for diffpy.structure (pyproject.toml) ... done
  Created wheel for diffpy.structure: filename=diffpy.structure-3.2.1rc1-py3-none-any.whl size=117000 sha256=6576bad2030cf77c434995c6ad0cd60d23d9581b8b8f07328d43f580c3a81657
  Stored in directory: /Users/hakon/Library/Caches/pip/wheels/0b/bc/54/c7ae5a7de90a8402f7b51677fbad2cb5327817e2e5b9853008
Successfully built diffpy.structure
Installing collected packages: ply, numpy, pycifrw, diffpy.structure
  Attempting uninstall: diffpy.structure
    Found existing installation: diffpy.structure 3.2.0
    Uninstalling diffpy.structure-3.2.0:
      Successfully uninstalled diffpy.structure-3.2.0
Successfully installed diffpy.structure-3.2.1rc1 numpy-1.26.4 ply-3.11 pycifrw-4.4.6

$ pip list
Package          Version
---------------- --------
diffpy.structure 3.2.1rc1
numpy            1.26.4
pip              24.2
ply              3.11
PyCifRW          4.4.6
setuptools       72.2.0
wheel            0.44.0

@sbillinge
Copy link
Contributor

I will make the full release now. It will be 3.2.1

@hakonanes hakonanes changed the title Dependencies not installed when installing from PyPI Dependencies not installed when installing v3.2.0 from PyPI Sep 4, 2024
@sbillinge
Copy link
Contributor

closed by #98 and tested

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

Successfully merging a pull request may close this issue.

2 participants