dfujim / bfit

A Python application for the analysis of β-NMR and β-NQR data taken at TRIUMF.
https://pypi.org/project/bfit/
GNU General Public License v3.0
0 stars 2 forks source link

trouble updating bfit #118

Open gdm2197 opened 8 months ago

gdm2197 commented 8 months ago

system is openSUSE Leap 15.5 Linux .... 5.14.21-150500.55.44-default #1 SMP PREEMPT_DYNAMIC Mon Jan 15 10:03:40 UTC 2024 (cc7d8b6) x86_64 x86_64 x86_64 GNU/Linux

Python 3.6.15 (system also has Python 2.7.18) pip3 21.3.1

Problem : upgrade can't get past bfit version 4.19.5, although version 4.21 is available. Messages during attempted update says : Collecting bfit Using cached bfit-4.20.4.tar.gz (305 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: matplotlib>=2.2.4 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (3.3.3) Requirement already satisfied: jax>=0.2.17 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (0.2.17) Requirement already satisfied: pyyaml>=5.1 in /usr/lib64/python3.6/site-packages (from bfit) (5.4.1) Requirement already satisfied: numpy>=1.19 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (1.19.5) Requirement already satisfied: wheel>=0.34 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (0.37.0) Requirement already satisfied: scipy>=1.2.0 in /usr/lib64/python3.6/site-packages (from bfit) (1.3.3) Requirement already satisfied: pytest>=4.5.0 in /usr/lib/python3.6/site-packages (from bfit) (5.4.3) Using cached bfit-4.20.3.tar.gz (305 kB) Preparing metadata (setup.py) ... done Collecting argparse>=1.4.0 Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB) Collecting bdata>=6.11.2 Using cached bdata-6.11.2.tar.gz (49 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: cython>=0.28 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (0.29.32) Requirement already satisfied: iminuit>=2.6.1 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (2.6.1) Requirement already satisfied: jaxlib>=0.1.69 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (0.1.69) Collecting bfit Using cached bfit-4.20.2.tar.gz (305 kB) Preparing metadata (setup.py) ... done Using cached bfit-4.20.1.tar.gz (305 kB) Preparing metadata (setup.py) ... done Using cached bfit-4.20.0.tar.gz (304 kB) Preparing metadata (setup.py) ... done Using cached bfit-4.19.7.tar.gz (304 kB) Preparing metadata (setup.py) ... done Using cached bfit-4.19.6.tar.gz (304 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: bdata>=6.8.2 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (6.8.2) Requirement already satisfied: requests>=2.25.0 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (2.25.0) Requirement already satisfied: pandas>=0.23.0 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (1.1.5) Requirement already satisfied: tqdm>=4.25.0 in /home/gmorris/.local/lib/python3.6/site-packages (from bfit) (4.53.0) Requirement already satisfied: mud-py>=1.2.8 in /home/gmorris/.local/lib/python3.6/site-packages (from bdata>=6.8.2->bfit) (1.2.8) Requirement already satisfied: absl-py in /home/gmorris/.local/lib/python3.6/site-packages (from jax>=0.2.17->bfit) (1.0.0) Requirement already satisfied: opt-einsum in /home/gmorris/.local/lib/python3.6/site-packages (from jax>=0.2.17->bfit) (3.3.0) Requirement already satisfied: flatbuffers<3.0,>=1.12 in /home/gmorris/.local/lib/python3.6/site-packages (from jaxlib>=0.1.69->bfit) (2.0) Requirement already satisfied: python-dateutil>=2.1 in /home/gmorris/.local/lib/python3.6/site-packages (from matplotlib>=2.2.4->bfit) (2.8.2) Requirement already satisfied: kiwisolver>=1.0.1 in /usr/lib64/python3.6/site-packages (from matplotlib>=2.2.4->bfit) (1.2.0) Requirement already satisfied: pillow>=6.2.0 in /home/gmorris/.local/lib/python3.6/site-packages (from matplotlib>=2.2.4->bfit) (8.0.1) Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /home/gmorris/.local/lib/python3.6/site-packages (from matplotlib>=2.2.4->bfit) (2.4.7) Requirement already satisfied: cycler>=0.10 in /home/gmorris/.local/lib/python3.6/site-packages (from matplotlib>=2.2.4->bfit) (0.10.0) Requirement already satisfied: pytz>=2017.2 in /home/gmorris/.local/lib/python3.6/site-packages (from pandas>=0.23.0->bfit) (2020.4) Requirement already satisfied: attrs>=17.4.0 in /home/gmorris/.local/lib/python3.6/site-packages (from pytest>=4.5.0->bfit) (21.2.0) Requirement already satisfied: more-itertools>=4.0.0 in /usr/lib/python3.6/site-packages (from pytest>=4.5.0->bfit) (8.10.0) Requirement already satisfied: packaging in /usr/lib/python3.6/site-packages (from pytest>=4.5.0->bfit) (20.3) Requirement already satisfied: pluggy<1.0,>=0.12 in /usr/lib/python3.6/site-packages (from pytest>=4.5.0->bfit) (0.13.1) Requirement already satisfied: py>=1.5.0 in /usr/lib/python3.6/site-packages (from pytest>=4.5.0->bfit) (1.10.0) Requirement already satisfied: wcwidth in /usr/lib/python3.6/site-packages (from pytest>=4.5.0->bfit) (0.1.8) Requirement already satisfied: importlib-metadata>=0.12 in /usr/lib/python3.6/site-packages (from pytest>=4.5.0->bfit) (1.5.0) Requirement already satisfied: idna<3,>=2.5 in /home/gmorris/.local/lib/python3.6/site-packages (from requests>=2.25.0->bfit) (2.10) Requirement already satisfied: certifi>=2017.4.17 in /home/gmorris/.local/lib/python3.6/site-packages (from requests>=2.25.0->bfit) (2020.11.8) Requirement already satisfied: chardet<4,>=3.0.2 in /home/gmorris/.local/lib/python3.6/site-packages (from requests>=2.25.0->bfit) (3.0.4) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/gmorris/.local/lib/python3.6/site-packages (from requests>=2.25.0->bfit) (1.26.2) Requirement already satisfied: six in /home/gmorris/.local/lib/python3.6/site-packages (from cycler>=0.10->matplotlib>=2.2.4->bfit) (1.15.0) Requirement already satisfied: zipp>=0.5 in /usr/lib/python3.6/site-packages (from importlib-metadata>=0.12->pytest>=4.5.0->bfit) (0.6.0) Installing collected packages: argparse Successfully installed argparse-1.4.0

Seems that it backs off until dependencies are satisfied, but there's no indication what the shortcoming is.
Any suggestions to update prerequisite packages or ...? Thanks.

dfujim commented 8 months ago

I'm not 100% sure what the problem is specifically, something to do with the dependencies. Some notes:

  1. As of v4.21.0, bfit uses the meson backend to build and compile. Meson requires as a minimum python 3.7 (I thought it was 3.9, but double-checking this, I seem to be wrong on that count, if you can only go as high as 3.7 let me know and I can experiment with various python versions to see what the actual minimum is needed to get this to work). This change was made to avoid using setuptools which has seen some issues lately, with a number of deprecated packages being removed in python 3.12. I believe that this will help future-proof bfit installation on newer systems for the next little while.
  2. The last content-related update was v4.20.3 (at the time of this writing, all further updates are just to accommodate install issues). At this point bfit no longer places restrictions on the python version, and I'm no longer sure what the issue is.

It's possible that there is something in the list of dependencies which itself requires python 3.7. My practice has been to periodically (as I change things) update the version numbers of the packages required to those installed on my setup, since I can guarantee that bfit will work with those versions. However, it is possible that it will run with earlier versions. I don't really have time to test and check the minimum version of each package. I'm not sure that this is best practice, but I would rather bfit crash on install than spit out bad results because of some missed update.

Here's a workaround, which should work up to and including version 4.20.3, until which point you absolutely need python3.7.

STEP 1: Clone the git repository.

git clone https://github.com/dfujim/bfit.git

STEP 2: Checkout the version you want. In this case we're going to check out version 4.20.3. You can get the SHA key from the commits page on github.

git checkout 994b4f602488c3803e6932c6d8b5796c6c0cd737

STEP 3: Edit setup.py and remove the version numbers on the dependencies. Change lines 57-61 to the following:

install_requires = ['cython', 'numpy', 'tqdm', 'bdata', 'matplotlib', 'pandas',
                      'pyyaml', 'scipy', 'iminuit', 'requests', 'argparse', 'pytest',
                      'wheel', 'jax', 'jaxlib'],

You may also need to change line 4 to

dist.Distribution().fetch_build_eggs(['cython', 'numpy'])

STEP 4: Install. Navigate your terminal to the top level bfit directory and run the following:

python3 -m pip install .

Note the period at the end, that's important. At this point, bfit will install and will check if the dependencies are installed, but it won't care about version numbers. If you get errors during runtime, then you need a newer version of something. This process could be repeated with bdata and mudpy as well if you think those are the problem packages (likely suspects).

For updates past this point 4.20.3 you'll need at least python 3.7. Likely best to just to right to python3.12 though.

gdm2197 commented 8 months ago

opensuse 15.5 is hopelessly behind at python 3.6.15.  I have yet to figure out how to add a recent version of python without breaking the system. This might push me to move to Fedora.

On 2024-02-15 10:54, Derek Fujimoto wrote:

You don't often get email from @.*** Learn why this is important https://aka.ms/LearnAboutSenderIdentification

I'm not 100% sure what the problem is specifically, something to do with the dependencies. Some notes:

  1. As of v4.21.0, bfit uses the meson backend to build and compile. Meson requires as a minimum python 3.7 (I thought it was 3.9, but double-checking this, I seem to be wrong on that count, if you can only go as high as 3.7 let me know and I can experiment with various python versions to see what the actual minimum is needed to get this to work). This change was made to avoid using setuptools which has seen some issues lately, with a number of deprecated packages being removed in python 3.12. I believe that this will help future-proof bfit installation on newer systems for the next little while.
  2. The last content-related update was v4.20.3 (at the time of this writing, all further updates are just to accommodate install issues). At this point bfit no longer places restrictions on the python version, and I'm no longer sure what the issue is.

It's possible that there is something in the list of dependencies which itself requires python 3.7. My practice has been to periodically (as I change things) update the version numbers of the packages required to those installed on my setup, since I can guarantee that bfit will work with those versions. However, it is possible that it will run with earlier versions. I don't really have time to test and check the minimum version of each package. I'm not sure that this is best practice, but I would rather bfit crash on install than spit out bad results because of some missed update.

Here's a workaround, which should work up to and including version 4.20.3, until which point you absolutely need python3.7.

STEP 1: Clone the git repository.

|git clone https://github.com/dfujim/bfit.git |

STEP 2: Checkout the version you want. In this case we're going to check out version 4.20.3. You can get the SHA key from the commits page on github.

|git checkout 994b4f602488c3803e6932c6d8b5796c6c0cd737 |

STEP 3: Edit |setup.py| and remove the version numbers on the dependencies. Change lines 57-61 https://github.com/dfujim/bfit/blob/d7072dbdfa0ad4a01f84be9db15634e39f0c673c/setup.py#L57-L61 to the following:

install_requires = ['cython','numpy','tqdm','bdata','matplotlib','pandas', 'pyyaml','scipy','iminuit','requests','argparse','pytest', 'wheel','jax','jaxlib'],

You may also need to change line 4 https://github.com/dfujim/bfit/blob/d7072dbdfa0ad4a01f84be9db15634e39f0c673c/setup.py#L4 to

dist.Distribution().fetch_build_eggs(['cython','numpy'])

STEP 4: Install. Navigate your terminal to the top level |bfit| directory and run the following:

python3 -m pip install.

Note the period at the end, that's important. At this point, bfit will install and will check if the dependencies are installed, but it won't care about version numbers. If you get errors during runtime, then you need a newer version of something. This process could be repeated with bdata and mudpy as well if you think those are the problem packages (likely suspects).

For updates past this point 4.20.3 you'll need at least python 3.7. Likely best to just to right to python3.12 though.

— Message ID: @.***>

--------------IaGR7OKcqts0ixMNQppKHiGc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

<!DOCTYPE html>

opensuse 15.5 is hopelessly behind at python 3.6.15.  I have yet to figure out how to add a recent version of python without breaking the system. This might push me to move to Fedora.




On 2024-02-15 10:54, Derek Fujimoto wrote:

You don't often get email from . Learn why this is important

I'm not 100% sure what the problem is specifically, something to do with the dependencies. Some notes:

  1. As of v4.21.0, bfit uses the meson backend to build and compile. Meson requires as a minimum python 3.7 (I thought it was 3.9, but double-checking this, I seem to be wrong on that count, if you can only go as high as 3.7 let me know and I can experiment with various python versions to see what the actual minimum is needed to get this to work). This change was made to avoid using setuptools which has seen some issues lately, with a number of deprecated packages being removed in python 3.12. I believe that this will help future-proof bfit installation on newer systems for the next little while.
  2. The last content-related update was v4.20.3 (at the time of this writing, all further updates are just to accommodate install issues). At this point bfit no longer places restrictions on the python version, and I'm no longer sure what the issue is.

It's possible that there is something in the list of dependencies which itself requires python 3.7. My practice has been to periodically (as I change things) update the version numbers of the packages required to those installed on my setup, since I can guarantee that bfit will work with those versions. However, it is possible that it will run with earlier versions. I don't really have time to test and check the minimum version of each package. I'm not sure that this is best practice, but I would rather bfit crash on install than spit out bad results because of some missed update.

Here's a workaround, which should work up to and including version 4.20.3, until which point you absolutely need python3.7.

STEP 1: Clone the git repository.

git clone https://github.com/dfujim/bfit.git

STEP 2: Checkout the version you want. In this case we're going to check out version 4.20.3. You can get the SHA key from the commits page on github.

git checkout 994b4f602488c3803e6932c6d8b5796c6c0cd737

STEP 3: Edit setup.py and remove the version numbers on the dependencies. Change lines 57-61 to the following:

install_requires = ['cython', 'numpy', 'tqdm', 'bdata', 'matplotlib', 'pandas',
                      'pyyaml', 'scipy', 'iminuit', 'requests', 'argparse', 'pytest',
                      'wheel', 'jax', 'jaxlib'],

You may also need to change line 4 to

dist.Distribution().fetch_build_eggs(['cython', 'numpy'])

STEP 4: Install. Navigate your terminal to the top level bfit directory and run the following:

python3 -m pip install .

Note the period at the end, that's important. At this point, bfit will install and will check if the dependencies are installed, but it won't care about version numbers. If you get errors during runtime, then you need a newer version of something. This process could be repeated with bdata and mudpy as well if you think those are the problem packages (likely suspects).

For updates past this point 4.20.3 you'll need at least python 3.7. Likely best to just to right to python3.12 though.


Message ID: <dfujim/bfit/issues/118/1946958417@github.com>


--------------IaGR7OKcqts0ixMNQppKHiGc--