Skip to content

Commit

Permalink
Temporarily restrict setuptools to <= 73.0
Browse files Browse the repository at this point in the history
CFFI is currently broken with setuptools 74.0, see python-cffi/cffi#118
  • Loading branch information
nhusung committed Aug 30, 2024
1 parent 0f2ca97 commit 998f4e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Repository = "https://github.com/OxiDD/oxidd"
Issues = "https://github.com/OxiDD/oxidd/issues"

[build-system]
requires = ["setuptools >= 61.0", "setuptools_scm >= 8"]
requires = ["setuptools >= 61.0, <= 73.0", "setuptools_scm >= 8"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
Expand Down

4 comments on commit 998f4e6

@MarkCallow
Copy link

Choose a reason for hiding this comment

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

Is this really fixing the cffi issue with the msvc9compiler being removed from distutils? I ask because my Python app in its requirements.txt specifies setuptools==70.0.0 yet my build has been broken by this issue.

Apologies for a slightly off-topic comment. I'm not sure where else to ask this.

@MarkCallow
Copy link

@MarkCallow MarkCallow commented on 998f4e6 Aug 31, 2024

Choose a reason for hiding this comment

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

I ask because my Python app in its requirements.txt specifies setuptools==70.0.0 yet my build has been broken by this issue.

I think I figured it out. My app is also requiring cffi and cffi must be requiring setuptools. I guess I'll have to wait for the cffi fix.

@nhusung
Copy link
Member Author

Choose a reason for hiding this comment

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

Is this really fixing the cffi issue with the msvc9compiler being removed from distutils?

Yes, this fixes the build in our case. Our setup of CFFI corresponds to the API mode, i.e., we use CFFI to compile a Python module. At runtime, we only need to load that module and do not require CFFI. It seems like the only issue was that CFFI loads the legacy distutils.msvc9compiler module, which is provided by setuptools ≤ 73.0.

I think I figured it out. My app is also requiring cffi and cffi must be requiring setuptools.

I’m a bit puzzled by that. If your requirements.txt specifies setuptools==70.0.0, shouldn’t CFFI load the distutils module of that setuptools version at runtime then? Or is the issue you face at runtime different from ModuleNotFoundError: No module named 'distutils.msvc9compiler'?

Apologies for a slightly off-topic comment. I'm not sure where else to ask this.

No worries, you’re welcome 🙂

@MarkCallow
Copy link

Choose a reason for hiding this comment

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

I’m a bit puzzled by that. If your requirements.txt specifies setuptools==70.0.0, shouldn’t CFFI load the distutils module of that setuptools version at runtime then? Or is the issue you face at runtime different from ModuleNotFoundError: No module named 'distutils.msvc9compiler'?

I'm no Python expert and did not write our Python interface. Yes I am seeing the error you mention. I will have to investigate further into how cffi is used. Tomorrow or Monday. It is late here now.

Please sign in to comment.