Skip to content

Commit

Permalink
Unpin setuptools for Python>=3.12 (#224)
Browse files Browse the repository at this point in the history
* Unpin setuptools for Python>=3.12

The version of setuptools pinned by the wheelhouse is incompatible with
python 3.12, to avoid breaking old charms, this patch unpins setuptools
only for python>=3.12

Fixes the following error at build time:

      File "/tmp/pip-download-gg1zdrmr/setuptools_ebd74bdeeaf0421480a69f5448330f5e/setuptools/__init__.py", line 16, in <module>
        import setuptools.version
      File "/tmp/pip-download-gg1zdrmr/setuptools_ebd74bdeeaf0421480a69f5448330f5e/setuptools/version.py", line 1, in <module>
        import pkg_resources
      File "/tmp/pip-download-gg1zdrmr/setuptools_ebd74bdeeaf0421480a69f5448330f5e/pkg_resources/__init__.py", line 2191, in <module>
        register_finder(pkgutil.ImpImporter, find_on_path)
                        ^^^^^^^^^^^^^^^^^^^
    AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

* Unpin setuptools-scm

Drop anyio and sniffio for python>=3.12, this allows them to be pulled
in indirectly by whoever needs them instead of carrying them as part of
layer basic

* Set TEST_JUJU3 env variable

When TEST_JUJU3 is set, zaza will allow the use of python-libjuju>=3.0

* Allow passing TEST_* env variables
  • Loading branch information
freyes authored Apr 15, 2024
1 parent 6f70ad3 commit 1edd5cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ jobs:
if: ${{ matrix.juju == '2.9' }}
run: |
echo "TEST_CONSTRAINTS_FILE=constraints-juju29.txt" >> $GITHUB_ENV
- name: Constrain Tox Environment for juju 3.x
if: ${{ matrix.juju == '3' }}
run: |
echo "TEST_JUJU3=1" >> $GITHUB_ENV
echo "TEST_CONSTRAINTS_FILE=constraints-juju3.txt" >> $GITHUB_ENV
- name: Install Dependencies
run: |
pip install tox
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ setenv =
CHARM_LAYERS_DIR=/tmp/charm-builds/_tmp/layers
passenv =
HOME
TEST_*
commands =
/bin/rm -rf /tmp/charm-builds/_tmp /tmp/charm-builds/minimal
/bin/rm -rf /tmp/charm-builds/_tmp /tmp/charm-builds/minimal-binary-wheels
Expand Down
10 changes: 6 additions & 4 deletions wheelhouse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ MarkupSafe<2.2.0;python_version >= '3.7' # newer pythons

setuptools<42;python_version < '3.8'
# https://github.com/juju-solutions/layer-basic/issues/201
setuptools<62.2.0;python_version >= '3.8'
setuptools<62.2.0;python_version >= '3.8' and python_version<'3.12'
setuptools>=62.2.0;python_version >= '3.12'
setuptools-scm<=1.17.0;python_version < '3.8'
# https://github.com/pypa/setuptools_scm/issues/722
setuptools-scm<7;python_version >= '3.8'
setuptools-scm<7;python_version >= '3.8' and python_version < '3.12'
setuptools-scm>=7;python_version >= '3.12'
flit_core<4.0.0;python_version >= '3.8'
flit_scm<=1.7.0;python_version >= '3.8'
charmhelpers>=0.4.0,<2.0.0
Expand All @@ -40,5 +42,5 @@ wheel<1.0;python_version >= '3.8'
netaddr<=0.7.19

# https://github.com/python-trio/sniffio/pull/49
anyio<3.7.0;python_version >= '3.8'
sniffio<1.3.1 # 1.3.1 requires setuptools>=64
anyio<3.7.0;python_version >= '3.8' and python_version < '3.12'
sniffio<1.3.1;python_version < '3.12' # 1.3.1 requires setuptools>=64

0 comments on commit 1edd5cc

Please sign in to comment.