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

Does not work with setup.py-less packaging? #105

Closed
wimglenn opened this issue Oct 28, 2019 · 10 comments · Fixed by #106
Closed

Does not work with setup.py-less packaging? #105

wimglenn opened this issue Oct 28, 2019 · 10 comments · Fixed by #106

Comments

@wimglenn
Copy link

I use setuptools with declarative config (i.e. defined in setup.cfg) and build system in pyproject.toml:

[build-system]
requires = [
    "setuptools >= 40.6.0",
    "wheel",
]
build-backend = "setuptools.build_meta"

This works fine to build wheels and sdist using the PEP 517 hooks (here).

But check-manifest doesn't recognize this as valid Python project.

$ check-manifest
This is not a Python project (no setup.py).
@mgedmin
Copy link
Owner

mgedmin commented Oct 28, 2019

Currently I run python setup.py sdist -d $tmpdir to create an sdist. What command can I run to create an sdist from a package that uses PEP-517?

The other part -- recognizing a PEP-517 package -- is simple: instead of checking for setup.py, I'd have to check for pyproject.toml.

@wimglenn
Copy link
Author

wimglenn commented Oct 28, 2019

It's a Python API - so any way you want to invoke the hook within isolated build environment. That could be python -m pep517.build . for example.

It’s likely that we’ll get a “pip build” command if pypa will ever finish bikeshedding whether this should belong to pip, twine, or separate tool entirely..

@mgedmin
Copy link
Owner

mgedmin commented Oct 28, 2019

pep517 seems workable, despite the "experimental" warning at the bottom.

@mgedmin
Copy link
Owner

mgedmin commented Oct 28, 2019

One more request: can you link me to a public GitHub repository of a project that uses PEP-517 builds so I have something I can test with?

@wimglenn
Copy link
Author

I've just pushed a minimal one for you to test with:
https://github.com/wimglenn/resources-example
https://pypi.org/project/resources-example/#files

Does that help?

mgedmin added a commit that referenced this issue Oct 29, 2019
@mgedmin mgedmin mentioned this issue Oct 29, 2019
1 task
@mgedmin
Copy link
Owner

mgedmin commented Oct 29, 2019

Thank you, that was very helpful!

I've a working prototype in #106.

@wimglenn
Copy link
Author

@mgedmin Hi Marius, thanks for the prompt fix. I've tried it out this morning, it works good for setuptools. For other build systems such as flit and poetry the approach might not work. That's because check-manifest copies source files to a temporary directory before build, but those newer build systems use the VCS subdirs in order to auto-detect which files to include in sdist. There may be an exception during sdist build if the VCS dirs are missing.

It's a moot point because the whole point of using vcs here is to avoid reinventing manifest (i.e. if you use something other than distutils/setuptools then you don't have or want a MANIFEST.in file in the first place). Feel free to just ignore/won't fix - the only possible use case I could see for check-manifest here would be for someone moving an existing project from flit back to setuptools or something like that.

@mgedmin
Copy link
Owner

mgedmin commented Oct 29, 2019

Yeah, Poetry was already mentioned in #103.

MANIFEST.in seems like a very setuptools-specific thing, so perhaps it would make sense to check if pyproject.toml is using setuptools, and silently skip (without exiting with an error code) projects that use different build systems.

I think I'll wait for people to ask for that explicitly before I start doing any more work.

@wimglenn
Copy link
Author

@mgedmin Just a heads up, the link back to this issue from CHANGES.rst is broken (missing an "s" in "issues")

@mgedmin
Copy link
Owner

mgedmin commented Nov 21, 2019

Thank you! I'd created a vim snippet that generates these bad issue URLs, oops!

mgedmin added a commit that referenced this issue Jan 7, 2020
As the PEP itself says, if pyproject.toml exists but doesn't have the
build-system table or the build-backend key in it, then tools should
fall back to legacy behaviour of running python setup.py.

See #110 (comment)

See also #105.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants