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

Unpin setuptools for Python>=3.12 #224

Merged
merged 4 commits into from
Apr 15, 2024
Merged

Conversation

freyes
Copy link
Contributor

@freyes freyes commented Apr 11, 2024

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'?

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'?
Copy link
Contributor

@ajkavanagh ajkavanagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the correct approach; I noticed a few other lines (not included in the change) which look odd that I've commented on.

wheelhouse.txt Outdated
@@ -26,7 +26,8 @@ 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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line may cause a problem; setupstools-scm is pinned for ever on later versions and not earlier ones; is this a typo from a previous commit?

wheelhouse.txt Outdated
@@ -41,4 +42,4 @@ netaddr<=0.7.19

# https://github.com/python-trio/sniffio/pull/49
anyio<3.7.0;python_version >= '3.8'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines also look a bit suspect.

freyes added 3 commits April 12, 2024 12:21
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
When TEST_JUJU3 is set, zaza will allow the use of python-libjuju>=3.0
@freyes freyes requested a review from ajkavanagh April 12, 2024 19:04
@ajkavanagh ajkavanagh merged commit 1edd5cc into canonical:master Apr 15, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants