-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add support for setup.cfg format? #132
Comments
My impression was that the ecosystem seems to be moving to the |
My understanding is that those are two separate things that are intended to work together. The |
The fact that different tools allow putting their configuration in |
In any case, when building with
and whatever other sections other tools might need. |
Ok. On a related note, you may notice that we already have support in the registry for parsing info from the aiida-registry/aiida_registry/fetch_metadata.py Lines 2 to 8 in ea54682
Once the direction of the overall ecosystem has converged (or has it already?), it would be great to define a strategy for where we want to go and suggest people to follow it. |
With regards to build systems, I think it's converging to having a top-level standard ( Is there a particular reason we're fetching the metadata from the repositories, instead of the built distributions that are already on PyPI? The format of metadata in {sdist, wheel} is AFAIK standardized in PEP 566, so it wouldn't matter how exactly it gets there -- developers can choose whichever build system / configuration format they like. |
There is certainly a historical one, namely that not all packages were/are on pypi. Fully agree this would be a nice improvement. |
What's your opinion on using e.g. On the other hand, adding support for different build systems ourselves feels like re-implementing things that For example: (aiida) $ time pip wheel --no-deps git+https://github.com/greschd/aiida-bands-inspect.git
Collecting git+https://github.com/greschd/aiida-bands-inspect.git
Cloning https://github.com/greschd/aiida-bands-inspect.git to /tmp/pip-req-build-uz4i3nqc
Running command git clone -q https://github.com/greschd/aiida-bands-inspect.git /tmp/pip-req-build-uz4i3nqc
Building wheels for collected packages: aiida-bands-inspect
Building wheel for aiida-bands-inspect (setup.py) ... done
Created wheel for aiida-bands-inspect: filename=aiida_bands_inspect-0.4.0-py3-none-any.whl size=16406 sha256=139d571db9fad274df36c9482f2f2e14557bda9b8ce8b9f5bed8e3234dd1d309
Stored in directory: /tmp/pip-ephem-wheel-cache-2koazn61/wheels/48/12/31/cf62798efecee1f93dca582734107983f38d814871bdeed8a7
Successfully built aiida-bands-inspect
real 0m3.694s
user 0m1.109s
sys 0m1.500s
(aiida) $ time wheel unpack aiida_bands_inspect-0.4.0-py3-none-any.whl
Unpacking to: ./aiida_bands_inspect-0.4.0...OK
real 0m0.163s
user 0m0.031s
sys 0m0.094s
(aiida) $ tree aiida_bands_inspect-0.4.0/aiida_bands_inspect-0.4.0.dist-info/
aiida_bands_inspect-0.4.0/aiida_bands_inspect-0.4.0.dist-info/
├── LICENSE.txt
├── METADATA
├── RECORD
├── WHEEL
├── entry_points.txt
└── top_level.txt
0 directories, 6 files |
Tested also with |
If there would be a large number of build systems I'd agree that this needs fixing. But given that their number is limited and the information reachable without having to execute code I fail to see the need for action here. fyi, for Poetry: |
@dev-zero what's your opinion on adding |
Right... it's a possibility and 10s per package won't kill us but I don't think it's really necessary.
Just to clarify: for the packages that are already on PyPI, fetching the information from there is an improvement -- there have already been cases where the setup.json in the respective |
For poetry, isn't the issue fixed with AFAICT the remainder of the discussion is about editable installs and other package installers. |
Yeah, if we implement fetching from PyPI (and thus parsing the |
Sure, since this will probably just be a couple of lines.
Since we already have it I'd keep it as a fallback for now for packages not (yet) released on pypi.
Which issue are you referring to now? For being able to install a package without a |
Yes, I though the link to python-poetry/poetry#761 was meant to say this doesn't work with poetry. Anyway, I agree with you here - we can add Surprisingly I haven't found an easy tool to load the data in |
Feel free to proceed in either direction - a PR to add support for parsing the setup.cfg would be welcome as well :-)
Of course, the first step is anyhow for someone to give it a try, and so there is no issue in adding support for it in the registry. Cheers, |
I'm not suggesting advertising it in any way 😉 In terms of benefits, the one I did find is that it allows a somewhat neat solution to the "duplicated version source" problem: The |
ha I was just coming here to see if an issue was open for this, and mention the version ting as I've just added it to aiidalab: https://github.com/aiidalab/aiidalab/pull/162/files definitely +1
Yeh hopefully with https://www.python.org/dev/peps/pep-0621/ now accepted, |
Additional FYI, apparently this is probably what a dynamic version will look like in |
Ok, I'm closing this with #190 for adding setup.cfg parsing (which I would most definitely advise over the bespoke setup.json). This also includes providing a We can open a separate issue for sourcing from PyPI at some point if you want. As already discussed, it's probably more consistent, but equally it seems that no one can actually be bothered to do it lol If we do, then this is the format of |
Setuptools provides the option use a
setup.cfg
configuration file instead of specifying everything insetup.py
(documentation).I think adding support for that would be pretty straightforward, using setuptools.config.read_configuration to parse the config.
Is there any interest in supporting this format? Remember, "PR welcome" is always a valid response 😉
The text was updated successfully, but these errors were encountered: