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

Update developer requirements.txt so folks can contribute using more recent Pythons #987

Open
pepi-p opened this issue Jul 28, 2024 · 4 comments · May be fixed by #997
Open

Update developer requirements.txt so folks can contribute using more recent Pythons #987

pepi-p opened this issue Jul 28, 2024 · 4 comments · May be fixed by #997
Labels
platform bug Bugs in operating systems, Python installations, or third-party packages

Comments

@pepi-p
Copy link

pepi-p commented Jul 28, 2024

I tried to batch install packages from https://github.com/pepi-p/python-skyfield/blob/master/requirements.txt on windows 11, MINGW64, Python 3.12.2, but It failed.
The reason was the imp module on which astropy 3.2.2 depends.

$ pip install -r requirements.txt
Collecting https://github.com/brandon-rhodes/assay/archive/master.zip (from -r requirements.txt (line 14))
  Using cached https://github.com/brandon-rhodes/assay/archive/master.zip
  Preparing metadata (setup.py) ... done
Collecting astropy==3.2.2 (from -r requirements.txt (line 1))
  Using cached astropy-3.2.2.tar.gz (8.0 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [92 lines of output]
        error: subprocess-exited-with-error

        python setup.py egg_info did not run successfully.
        exit code: 1

        [15 lines of output]
        C:\Users\pepip\AppData\Local\Temp\pip-wheel-ttkhq3ks\astropy-helpers_a11538e9b1b1457a974ec7b85cb05777\setup.py:13: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
          if LooseVersion(setuptools.__version__) < '30.3':
        Traceback (most recent call last):
          File "<string>", line 2, in <module>
          File "<pip-setuptools-caller>", line 34, in <module>
          File "C:\Users\pepip\AppData\Local\Temp\pip-wheel-ttkhq3ks\astropy-helpers_a11538e9b1b1457a974ec7b85cb05777\setup.py", line 17, in <module>
            from astropy_helpers.version_helpers import generate_version_py  # noqa
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "C:\Users\pepip\AppData\Local\Temp\pip-wheel-ttkhq3ks\astropy-helpers_a11538e9b1b1457a974ec7b85cb05777\astropy_helpers\version_helpers.py", line 34, in <module>
            from .distutils_helpers import is_distutils_display_option
          File "C:\Users\pepip\AppData\Local\Temp\pip-wheel-ttkhq3ks\astropy-helpers_a11538e9b1b1457a974ec7b85cb05777\astropy_helpers\distutils_helpers.py", line 18, in <module>
            from .utils import silence
          File "C:\Users\pepip\AppData\Local\Temp\pip-wheel-ttkhq3ks\astropy-helpers_a11538e9b1b1457a974ec7b85cb05777\astropy_helpers\utils.py", line 4, in <module>
            import imp
        ModuleNotFoundError: No module named 'imp'
        [end of output]

Since the latest version of astropy is 6.1.2 and the version specified in requirements.txt is 3.2.2, it seems that the problem can be solved by depending on a newer version of astropy.

@brandon-rhodes brandon-rhodes added the platform bug Bugs in operating systems, Python installations, or third-party packages label Aug 5, 2024
@brandon-rhodes brandon-rhodes changed the title astropy 3.2.2 installation fails due to missing imp module (Windows 11, MINGW64, Python 3.12.2) Update developer requirements.txt so folks can contribute using more recent Pythons Aug 5, 2024
@brandon-rhodes
Copy link
Member

The last time I tried updating requirements.txt, it burned something like an entire day of work, and I still couldn't get a working set of dependencies all working together. Plus it will require rewriting doctests, since some of the libraries have changed things like their repr() behaviors. But I'll keep the idea on my long-term-improvements list; in the meantime, I'm happy at least that Skyfield itself still works on the most recent versions of Python.

I wish the Python community had more respect for other people's time, and would maintain backwards compatibility.

@EndlessDex
Copy link

EndlessDex commented Aug 18, 2024

@brandon-rhodes here is a working requirements.txt using all latest packages except for the commented ones.

Passes all tests. No code changes required. But does make min python version 3.10 due to astropy. Dropping astropy from latest (6.1.2) down to (6.0.1) makes min python version 3.9 instead. Both options fix OP's initial issue of imp deprecation. Python 3.8 is EOL at the end of this year so I didn't check for that one.

Only two problem packages:

  1. numpy: As you stated its repr changed from 64.0 to np.float(64.0)
  2. sphinx: Something weird about not finding Time.M.

Locking sphinx to v2.4.5 unfortunately makes it necessary to pin sphinxcontrib-*, alabaster, and jinja2 as well.

# python>=3.10
astropy==6.1.2
beautifulsoup4==4.12.3
html5lib==1.1.0
lxml==5.3.0
mock==5.1.0
numpy==1.26.4 # breaks if upgraded to v2.0.0 due to repr changes
matplotlib==3.9.2
pandas==2.2.2
pyflakes==3.2.0
python-dateutil>=2.5.0
pytz
sphinx==2.4.5 # breaks if upgraded to v3.0.0
jinja2==3.0.3 # breaks if upgraded to v3.1.0 due to deprecated functions
alabaster==0.7.13 # alabaster>=0.7.14 requiers sphinx>=3.4.0
sphinxcontrib-applehelp==1.0.4 # sphinxcontrib-applehelp>=1.0.5 requires sphinx>=5.0.0
sphinxcontrib-devhelp==1.0.2 # sphinxcontrib-devhelp>=1.0.3 requires sphinx>=5.0.0
sphinxcontrib-htmlhelp==2.0.1 # sphinxcontrib-htmlhelp>=2.0.2 requires sphinx>=5.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3 # sphinxcontrib-qthelp>=1.0.4 requires sphinx>=5.0.0
sphinxcontrib-serializinghtml==1.1.5 # sphinxcontrib-serializinghtml>=1.1.6 requires sphinx>=5.0.0
spktype21
https://github.com/brandon-rhodes/assay/archive/master.zip

@EndlessDex
Copy link

Also, as a side note, there appears to be some sort of race condition in assay regarding the tracking of files. Sometimes it reports an unclosed files warning and other times not. Sometime it also gets RuntimeError: dictionary changed size during iteration but only rarely.

@EndlessDex EndlessDex linked a pull request Aug 18, 2024 that will close this issue
@EndlessDex
Copy link

EndlessDex commented Aug 18, 2024

So I went down a rabbit hole of your CI pipeline and whatnot and ended up making a PR for my proposed updates 😅 ...

You can see the action results here: https://github.com/EndlessDex/python-skyfield/actions/runs/10443120176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform bug Bugs in operating systems, Python installations, or third-party packages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants