kif / multianalyzer

Rebinning of powder diffraction data taken with multiple analyzer crystals and a large area detector
MIT License
0 stars 2 forks source link

provide pyproject which limits the version of setutools #9

Closed kif closed 2 years ago

kif commented 2 years ago

close #8

woutdenolf commented 2 years ago

Seems like we did the same thing: https://github.com/kif/multianalyzer/pull/10

From what I tested locally you need setuptools<54

kif commented 2 years ago

according to numpy, it is setuptools<60 Anyway, if >=60 is installed, the code does not build. I'll upgrade to meson once it is ready.

woutdenolf commented 2 years ago

Are you sure? Because this does not work (python 3.8)

python -m pip install git+https://github.com/kif/multianalyzer.git@fix-installer

while this does work

python -m pip install git+https://github.com/woutdenolf/multianalyzer.git@restrict_setuptools
kif commented 2 years ago

It does work:

lintaillefer:/tmp % source ~/.venv/py38/bin/activate
(py38) lintaillefer:/tmp % python -m venv /tmp/py38
(py38) lintaillefer:/tmp % deactivate 
lintaillefer:/tmp % source /tmp/py38/bin/activate
(py38) lintaillefer:/tmp % python -m pip install git+https://github.com/kif/multianalyzer.git@fix-installer
Collecting git+https://github.com/kif/multianalyzer.git@fix-installer
  Cloning https://github.com/kif/multianalyzer.git (to revision fix-installer) to /tmp/pip-req-build-ed3m960e
  Running command git clone -q https://github.com/kif/multianalyzer.git /tmp/pip-req-build-ed3m960e
  Running command git checkout -b fix-installer --track origin/fix-installer
  Switched to a new branch 'fix-installer'
  Branch 'fix-installer' set up to track remote branch 'fix-installer' from 'origin'.
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied (use --upgrade to upgrade): multianalyzer==0.4.0 from git+https://github.com/kif/multianalyzer.git@fix-installer in /users/kieffer/workspace-400/multianalyzer
Collecting hdf5plugin (from multianalyzer==0.4.0)
  Downloading https://files.pythonhosted.org/packages/22/55/8f35321ff689a26cd8b99c4cae3908decd007f7553e651f6141ef9853465/hdf5plugin-3.3.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (6.0MB)
     |████████████████████████████████| 6.0MB 9.3MB/s 
Collecting h5py (from multianalyzer==0.4.0)
  Downloading https://files.pythonhosted.org/packages/4b/ad/67136179798bef7f49eebac34024f9dc3052f4c4a5d1372fcfd5dd9aca5f/h5py-3.7.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.5MB)
     |████████████████████████████████| 4.5MB 14.4MB/s 
Requirement already satisfied: setuptools in /tmp/py38/lib/python3.8/site-packages (from multianalyzer==0.4.0) (41.2.0)
Collecting numpy>=1.17.3 (from multianalyzer==0.4.0)
  Downloading https://files.pythonhosted.org/packages/03/c6/14a17e10813b8db20d1e800ff9a3a898e65d25f2b0e9d6a94616f1e3362c/numpy-1.23.0.tar.gz (10.7MB)
     |████████████████████████████████| 10.7MB 38.2MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: multianalyzer, numpy
  Building wheel for multianalyzer (PEP 517) ... done
  Created wheel for multianalyzer: filename=multianalyzer-0.4.0-cp38-cp38-linux_x86_64.whl size=647285 sha256=e962f99098d4997f572ecfd236e04a070260fc90415ba025d2e4da72a94606d0
  Stored in directory: /tmp/pip-ephem-wheel-cache-f5_2pqer/wheels/73/74/e7/72ea4d4499643ed69634a84f0d0aecf9899bf3582611c35ad3
  Building wheel for numpy (PEP 517) ... done
  Created wheel for numpy: filename=numpy-1.23.0-cp38-cp38-linux_x86_64.whl size=21279345 sha256=ff242a251945b4e8f5ccc83484abaa281acb776193366119956691c8b3976043
  Stored in directory: /users/kieffer/.cache/pip/wheels/94/bf/88/b59e958b51083bf8462de38ebcb8472813f7535f281daebdd9
Successfully built multianalyzer numpy
Installing collected packages: numpy, h5py, hdf5plugin
Successfully installed h5py-3.7.0 hdf5plugin-3.3.1 numpy-1.23.0
WARNING: You are using pip version 19.2.3, however version 22.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(py38) lintaillefer:/tmp % python
Python 3.8.0 (default, Nov  6 2019, 21:49:08) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

it is slightly more complicated ... it can work or not depending on the version of setuptools installed in the venv. If the version is old enough, it is OK, if it is too recent it fails since the version wont be downgraded.

woutdenolf commented 2 years ago

since the version wont be downgraded.

I have a py38 venv with the latest setuptools. In that case this works

python -m pip install git+https://github.com/woutdenolf/multianalyzer.git@restrict_setuptools

and this does not work

python -m pip install git+https://github.com/kif/multianalyzer.git@fix-installer
kif commented 2 years ago

OK, so let's limit to setuptools v54