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

pganssle
Copy link
Member

@pganssle pganssle 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

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.
@RonnyPfannschmidt
Copy link
Contributor

How can setuptools-scm integrate with this?

@pganssle
Copy link
Member Author

pganssle 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
Copy link
Contributor

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

@RonnyPfannschmidt
Copy link
Contributor

unfortunately i cant work on it myself in forseeable future

@pganssle
Copy link
Member Author

pganssle 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
Copy link
Contributor

@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
Copy link
Member Author

pganssle 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
@pradyunsg
Copy link
Member

Wheeee! This is great!

@webknjaz
Copy link
Member

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
Copy link
Member Author

@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
Copy link
Member

👍 new release would be nice :)

@astrojuanlu
Copy link
Contributor

astrojuanlu 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 optional_setup_py branch April 4, 2019 15:00
@pganssle
Copy link
Member Author

pganssle 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
Copy link
Member

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.)

nbraud added a commit to nbraud/emanate that referenced this pull request Jun 19, 2019
pypa/setuptools#1675 made it optional, and was merged in v40.9.0.
nbraud added a commit to nbraud/emanate that referenced this pull request Jun 22, 2019
pypa/setuptools#1675 made it optional, and was merged in v40.9.0.
nbraud added a commit to nbraud/emanate that referenced this pull request Jun 22, 2019
pypa/setuptools#1675 made it optional, and was merged in v40.9.0.
@nbraud nbraud mentioned this pull request Jun 22, 2019
2 tasks
nbraud added a commit to nbraud/emanate that referenced this pull request Jun 22, 2019
pypa/setuptools#1675 made it optional, and was merged in v40.9.0.
nbraud added a commit to nbraud/emanate that referenced this pull request Jun 24, 2019
pypa/setuptools#1675 made it optional, and was merged in v40.9.0.
nbraud added a commit to nbraud/emanate that referenced this pull request Jun 26, 2019
pypa/setuptools#1675 made it optional, and was merged in v40.9.0.
duckinator pushed a commit to duckinator/emanate that referenced this pull request Jun 16, 2020
pypa/setuptools#1675 made it optional, and was merged in v40.9.0.

Signed-off-by: Ellen Marie Dash <[email protected]>
duckinator pushed a commit to duckinator/emanate that referenced this pull request Jun 16, 2020
pypa/setuptools#1675 made it optional, and was merged in v40.9.0.

Signed-off-by: Ellen Marie Dash <[email protected]>
bors bot added a commit to duckinator/emanate that referenced this pull request Jun 16, 2020
136: Remove setup.py. r=duckinator a=duckinator

Replaces and closes #58.

Original description for #58:

> Followup on #55.
> 
> - [x] Get rid of `setup.py`, which was made optional by pypa/setuptools#1675.
> - [x] Set a version requirement for `setuptools`.

Co-authored-by: Nicolas Braud-Santoni <[email protected]>
Co-authored-by: Ellen Marie Dash <[email protected]>
bors bot added a commit to duckinator/emanate that referenced this pull request Jun 16, 2020
136: Remove setup.py. r=duckinator a=duckinator

Replaces and closes #58.

Original description for #58:

> Followup on #55.
> 
> - [x] Get rid of `setup.py`, which was made optional by pypa/setuptools#1675.
> - [x] Set a version requirement for `setuptools`.

Co-authored-by: Nicolas Braud-Santoni <[email protected]>
Co-authored-by: Ellen Marie Dash <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants