Repository navigation
fix: add a few missing parts to setup.cfg setup - #823
Conversation
|
FYI, the example I've used for the last year or so is here: https://scikit-hep.org/developer/packaging#setup-configuration-medium-priority, which has a few extra options set and uses /src layout. |
|
@henryiii the PR title doesn't seem to reflect what you did here |
|
There are three changes; I've added Is that better? |
|
Honestly, I find it easier to review/approve separate unrelated changes so if one of the updates wouldn't block others from being merged. |
| description = A small example package | ||
| long_description = file: README.md | ||
| long_description_content_type = text/markdown | ||
| url = https://github.com/pypa/sampleproject |
There was a problem hiding this comment.
I think it may be useful to also mention project_urls demonstrating links to issues/docs/CI/etc
There was a problem hiding this comment.
I was trying to exactly replicate the setup.py example with no changes; would be happy to add a follow-on PR that adds anything that would be useful to add to the example.
There was a problem hiding this comment.
Personally, I didn't know about / start using project_urls until fairly recently, I don't I've even added it to the scikit-hep dev docs yet. But it is really nicely displayed in PyPI, so I think it's a good idea, even if not really minimal.
There was a problem hiding this comment.
Yeah, I think I've been using it for the last 3-4 years maybe...
| - ``packages`` is a list of all Python :term:`import packages <Import | ||
| Package>` that should be included in the :term:`Distribution Package`. | ||
| Instead of listing each package manually, we can use :func:`find_packages` | ||
| to automatically discover all packages and subpackages. In this case, the | ||
| list of packages will be ``example_pkg`` as that's the only package present. | ||
| - ``python_requires`` gives the versions of Python supported by your | ||
| project. Installers like pip will look back though older versions of | ||
| packages until it finds one that has a matching Python version. |
There was a problem hiding this comment.
Would it be possible to deduplicate the copy-pasted explanations? Do you think using the .. include:: directive would help here, or maybe replace substitutions?
There was a problem hiding this comment.
Only some of them match; the "packages" description right above it, for example, does not match since it has a discussion of the find: directive in one case, and setuptools.find_packages() in the other.
There was a problem hiding this comment.
Can you include from the same file? It might be fragile, though.
There was a problem hiding this comment.
I think you can only "include" from the same file with substitutions. Including with "start+end" of itself with the include directive sounds a bit wild but I don't see why it wouldn't work (at least in cases when you don't include the place with the directive itself) 🤯
|
Should I break it out? It's really just follow up cleanup to #818, and reordering doesn't go well in parallel with other changes. Happy to pull out in any order you want, though. |
Usually when the title contains references to many things, has "and" in it, or is too vague within the 50 char limit, it's a sign that the PR is too broad and when you can describe its separate parts with a few specific titles, it's a good idea to have a PR per such a title. The person who would merge the PR may get stuck trying to come up with a good commit message for the merge when they'll be attempting to replace "do something related to setup.cfg" with anything that would give the reader any idea what the commit is about. |
|
It would be nice to get this in, it's an edit to something I originally wrote in #818, and the missing line is tripping people up. If there's an issue with something above, I can pull out just the missing line, but there should not be anything controversial in it, I'm just matching the option order, adding the missing line, and added a missing description. I'm about to take off two weeks for the upcoming birth of my daughter, so would prefer not to make a series of very tiny PRs that have to be sequential... |
In python#823, it was mentioned that project_urls might be a good thing to show. This adds that example.
Closes pypa/packaging-problems#436
I've reordered the fields to match the description order, and synced the description orders for the two tabs. (I think I matched the order that is given in the setuptools docs originally for the cfg lines). I also added a missing description for
python_requiresto both tabs.Personally, I rather think
python_requiresshould have been metadata, not options, since it fills the Requires-Python slot, but it is in options.