airr-community / airr-standards

AIRR Community Data Standards
https://docs.airr-community.org
Creative Commons Attribution 4.0 International
35 stars 23 forks source link

Incompatibility with Python 3.12 #788

Closed ddiez closed 1 month ago

ddiez commented 1 month ago

I tried installing the airr package with Python 3.12 and got the following error:

~$ pip install airr
Collecting airr
  Using cached airr-1.5.0.tar.gz (64 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      /tmp/pip-install-o4j0x2bo/airr_13e65210b78a41cb8c85bc48adf90011/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-o4j0x2bo/airr_13e65210b78a41cb8c85bc48adf90011/setup.py", line 21, in <module>
          version=versioneer.get_version(),
                  ^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-o4j0x2bo/airr_13e65210b78a41cb8c85bc48adf90011/versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "/tmp/pip-install-o4j0x2bo/airr_13e65210b78a41cb8c85bc48adf90011/versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-o4j0x2bo/airr_13e65210b78a41cb8c85bc48adf90011/versioneer.py", line 342, in get_config_from_root
          parser = configparser.SafeConfigParser()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

The same does not happen with Python 3.11.

schristley commented 1 month ago

Hi @ddiez I believe we are working on that exact issue. If you are feeling adventurous, you can try the 1.5 release branch to see if it works for you, otherwise we should have a new release soon.

git clone https://github.com/airr-community/airr-standards.git
cd airr-standards
git checkout release-1.5
cd lang/python
pip install .
ddiez commented 1 month ago

@schristley good to know. Thanks!

VincentGardeux commented 1 month ago

A quick fix is to download the airr-py-1.5.0.tar.gz from the release section, then

tar -xzvf airr-py-1.5.0.tar.gz
cd airr-1.5.0/
sed -i 's/SafeConfigParser/ConfigParser/g' versioneer.py
sed -i 's/readfp/read_file/g' versioneer.py
python3.12 -m pip install .

SafeConfigParser was replaced by ConfigParser in latest Python v3.12

ssnn-airr commented 1 month ago

Linking to the original issue for context #742

One more way to install from the main branch:

pip3 install -e "git+https://github.com/airr-community/airr-standards.git#egg=airr&subdirectory=lang/python"

If you want to use a specific commit:

pip3 install -e "git+https://github.com/airr-community/airr-standards.git@b3e4a69169200b2644cb7e0e534f1781b68829f1#egg=airr&subdirectory=lang/python"
javh commented 1 month ago

This should now be fixed in v1.5.1 on PyPI: https://pypi.org/project/airr/1.5.1

Thanks for the report and let us know if you have any more trouble.

ddiez commented 1 month ago

I tested and it worked without issues. Thanks!