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

Support for declarative project configuration (setup.cfg / pyproject.toml) #55

Open
schlamar opened this issue Feb 2, 2024 · 4 comments

Comments

@schlamar
Copy link

schlamar commented Feb 2, 2024

There was a ticket in heptapod including a patch to support configuration of cffi modules in setup.cfg https://foss.heptapod.net/pypy/cffi/-/issues/396

Personally, I would prefer a configuration in pyproject.toml as this seems to be the new standard everyone is adopting.

@arigo
Copy link
Contributor

arigo commented Feb 2, 2024

I won't work on it as long as the existing solution works fine, but I'm not against it, if the new way works in older systems too. Pull requests welcome. See e.g. https://github.com/python-cffi/cffi/actions/runs/7709709848 for the list of supported versions of Pythons. (Ideally it should also work if the user uses some setuptools that was installed at the time of that Python release and not updated since. I'm pretty sure that's a completely unrealistic expectation, though, so take that with a grain of salt.)

@genotrance
Copy link

Here's my setup.py:

from setuptools import setup

setup(
    cffi_modules=["mcurl/gen.py:ffibuilder"]
)

Everything else is in pyproject.toml and it works on Python 3.6+ on Windows, Linux (glibc/musl, x86_64/i686/aarch64) and OSX. Will be nice to move this into pyproject.toml.

@James-E-A
Copy link
Contributor

Everything else is in pyproject.toml and it works on Python 3.6+ on Windows, Linux (glibc/musl, x86_64/i686/aarch64) and OSX. Will be nice to move this into pyproject.toml.

@genotrance Does your project support ABI3?

In my own project, I've got that file still existing for two reasons: one of them is to keep cffi_modules referenced, and the other is to make ABI3 work with CFFI.

I'm not sure my solution is a good one, though, and I'm also trying to ditch setup.py and move to a "pure" pyproject.toml, so I'm curious how other people are handling this.

@genotrance
Copy link

Yes it supports ABI3 - here's how I am specifying it via the CLI. The resulting wheels run on every version of Python I've tested.

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

No branches or pull requests

4 participants