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

Add support for setup.cfg-only projects #1675

Merged
merged 2 commits into from Feb 8, 2019

Conversation

Projects
None yet
6 participants
@pganssle
Copy link
Member

commented Feb 5, 2019

Many projects can get away with an empty setup.py and use only the declarative setup.cfg. With the new PEP 517 backend, we can supply a default empty setup.py if one is not provided.

Pull Request Checklist

  • Changes have tests
  • News fragment added in changelog.d. See documentation for details

pganssle added some commits Jan 31, 2019

Add support for setup.cfg-only projects
Many projects can get away with an empty `setup.py` and use *only* the
declarative `setup.cfg`. With the new PEP 517 backend, we can supply a
default empty `setup.py` if one is not provided.

@pganssle pganssle force-pushed the pganssle:optional_setup_py branch from de7467b to 6bda3d5 Feb 7, 2019

@pganssle pganssle added the enhancement label Feb 7, 2019

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2019

How can setuptools-scm integrate with this?

@pganssle

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2019

@RonnyPfannschmidt I think there's an open issue about that. This PR is just to allow people who already can have an empty setup invocation to dispense with the setup.py file.

I am very interested in other PRs that will increase the number of people who can use this, though.

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2019

@pganssle basically if this goes in and setuptools_scm can be supported, i'll be able to drop setup.py in pytest

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2019

unfortunately i cant work on it myself in forseeable future

@pganssle

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2019

I like the idea, but one warning is that with that plan is that it makes pip >= 19 a hard dependency for building pytest from an sdist. The fact that pytest ships a universal wheel means that will probably be OK, but I think you'll be fielding bug reports over that for a while.

For major libraries and applications like pytest, I recommend keeping at least a token setup.py in your repo for a while - at least until pip's PEP 517 support stabilizes a bit more.

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2019

@pganssle that's very true, however the earlier the toolchain can support this the earlier the mid/end 2020 pytest which has dropped python2 can adopt more modern packaging (for me the time with the first fully supported feature set in setuptools, marks a key date for the transition scheduling of pytest

@pganssle

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2019

Sounds to me like we're all in agreement that this is a good thing, and if anything it doesn't go far enough. I'm going to merge this.

I will create a new issue for "write documentation for build_meta", which is where this should be documented.

@pganssle pganssle merged commit cdb5eea into pypa:master Feb 8, 2019

5 checks passed

codecov/patch 100% of diff hit (target 82.65%)
Details
codecov/project 82.66% (+<.01%) compared to c1243e9
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
@pradyunsg

This comment has been minimized.

Copy link
Member

commented Feb 9, 2019

Wheeee! This is great!

@webknjaz

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2019

I was about to use it and it didn't work so then I checked dates and realized that it's been merged just 3 days after the last release...

@pganssle are you planning a release anytime soon?

@pganssle

This comment has been minimized.

Copy link
Member Author

commented Mar 16, 2019

@webknjaz Yeah, I've been bitten by this myself as well. I think I was just delaying a release until after HackIllinois because I expected we might do a lot then. I see no problem with cutting a new release soon.

@webknjaz

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2019

👍 new release would be nice :)

@Juanlu001

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2019

Congratulations!

One question: setup.py is still required for --editable installs, correct? I tried to use the new functionality and got this errors:

(py37_st40_9_0) $ pip install -e .
File "setup.py" not found. Directory cannot be installed in editable mode: /home/juanlu/IE/2019/03_advanced-python/ie-nlp-utils
(A "pyproject.toml" file was found, but editable mode currently requires a setup.py based build.)

@pganssle pganssle deleted the pganssle:optional_setup_py branch Apr 4, 2019

@pganssle

This comment has been minimized.

Copy link
Member Author

commented Apr 4, 2019

@Juanlu001 The only requirement is that whatever front-end you are using needs to invoke our PEP 517 build backend, setuptools.build_meta, so I think it's just that pip doesn't have PEP 517 support for editable installs.

It looks like @cjerdonek has a related PR in pypa/pip#6370, but from a casual glance it doesn't seem to be adding actual PEP 517 support for editable installs. Looks like PEP 517 itself doesn't cover editable installs. Might be a good topic to bring up on the discourse.

@cjerdonek

This comment has been minimized.

Copy link
Member

commented Apr 4, 2019

so I think it's just that pip doesn't have PEP 517 support for editable installs.

Looks like PEP 517 itself doesn't cover editable installs.

Right, there's not actually such a thing as a PEP 517 editable install. From the PEP:

Note: Editable installs - This PEP originally specified another hook, install_editable, to do an editable install (as with pip install -e). It was removed due to the complexity of the topic, but may be specified in a later PEP.

Thus, pip shouldn't ever be invoking the PEP 517 process when editable mode was requested. (There are a couple bugs in pip around this, currently. The PR @pganssle linked above resolves the last of them, I believe.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.