-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
Upgrade the packaging setup #642
Comments
@webknjaz Will highly appreciate PR for these, I could learn new things :). I am stuck in classic vanilla setup.py workflows and seemingly things have evolved a lot in this aspect. Thank you 👍 |
Woah! Among other problems, there are no wheels uploaded for the last versions on PyPI (since 2019!) |
First improvement done: #647. |
@abhinavsingh I've submitted a number of the linting setup maintainability improvements. The last one includes everything but I thought it would probably be easier/more digestible if the building blocks were their own atomic PRs:
This setup is rather strict but has a lot of excludes in the config because there's a lot of the linting violations that get revealed otherwise. I think it'd make a nice series of "good first issues" for beginner contributors to improve. |
+1 on top #658 |
This comment has been minimized.
This comment has been minimized.
Uncommented another fixer on top: #661 |
And here's two more improvements: I'm starting to hit merge conflicts so I'll pause for some time to give you a chance to get these merged before I add more. |
@webknjaz Yes naming shouldn't be an issue. My original intention here was to surface enough context via job names. Checking on the PRs. |
Yeah I see that. But currently you repeat the same context in many places. Job names show up right after the workflow names in all of the UIs. Plus adding the project name is not particularly useful since when you look at the CI pages, it's visible what repo they are in. |
@abhinavsingh here are fixes for the |
This comment has been minimized.
This comment has been minimized.
@abhinavsingh this is interesting... are you on macOS? Locally, I run Gentoo Linux and GHA and |
pylint-dev/pylint#4759 (comment) seems to suggest that Python shipped by |
Yep, I am on |
Well, we could apply inline disables for those cases. Or maybe add a transform plugin https://pylint.pycqa.org/en/latest/how_tos/transform_plugins.html. But I'd argue that this is a band-aid and would just shadow the real issue of having a bad CPython env, and people should be encouraged to fix their dev envs (which is probably what this false-positive really reveals). |
So here's some job/workflow name updates making them mostly fit in the UI: |
@webknjaz I checked random repositories on Github and looks like along with from setuptools import setup
setup() See https://github.com/search?q=filename%3A.pyup.yml+setup.cfg&type=code for reference. I searched this to understand why |
setuptools supports not having As for pyup, I don't know. You could probably configure it to exclude |
Thank you, makes sense. I haven't kept up with changes of late. I also observed Any hints what might have gone wrong here. Root directory context doesn't change, so |
Here's a doc on the config file: https://pyup.io/docs/bot/config/#specifying. Or you could just migrate to Dependabot like others did. |
I think that the official codecov GHA looks for an XML report that pytest does not currently produce. I was going to fix it by add |
Will deprecate
Yep this probably should fix it :). Thank you |
@webknjaz I realized that |
Oh, this reminds me that I forgot to increase the number of processes for pylint. flake8 already has |
A few more forgotten bits: |
Ah, so that's a totally different problem. The apidoc extension generates RST files under |
This is clearly visible in the output. Both checking consistency... /Users/abhinavsingh/Dev/proxy.py/docs/pkg/proxy.common._compat.rst: WARNING: document isn't included in any toctree and /Users/abhinavsingh/Dev/proxy.py/docs/pkg/proxy.common._compat.rst:2: Spell check: compat: ["compact", "cowpat", "Compaq", "combat", "compete", "comport", "compote", "compute", "comped", "com pat", "com-pat", "comp at", "comp-at", "compost", "company", "compare", "comps", "comp", "compass", "computer", "comet", "compo", "commit", "comp's"]: proxy.common._compat module. Point at |
Thank you, feels so silly now. Correct, it's under |
Ended up adding a |
Hi @webknjaz Hope all is well at your end. Yesterday I was trying to bundle I think we need something similar to how Wondering if there are any go-to recommended ways to implement this? TL;DR -- We simply need to run Thank you |
Never mind, looks like, I had to override the |
Alternatively, you could have an in-tree PEP 517 build backend that wraps the |
Bingo :) Couldn't wrap my head around this. |
This is because the in-tree backends usually target a narrow use-case, and support for them was added to PEP 517 later. Also, using the backend-specific mechanisms is not wrong. It's just my preference to avoid this. Plus, if you ever want to switch to things other than setuptools, you'd need to port the config to a different backend while with your own in-tree backend, it's more portable. |
Hi @webknjaz , I think we are almost there. Sorry for delaying the formal release. Probably I can release For docs, I wish I don't have to write separate markdown files. But instead, I want our doc parser to get content out of class or module descriptions. Example, let's consider the following hypothetical file $ cat example.py
"""
Module documentation, which can go in detail explaining why this module exists, how to use it in standalone fashion etc.
"""
class Example:
"""Class level doc."""
pass Can we have a process to generate Main motivation here is to avoid keeping docs outside of the source files. |
There are different kinds of docs. The autogenerated docs section already does that: https://proxypy.readthedocs.io/en/latest/pkg/proxy.core.work/#module-proxy.core.work. |
FWIW I think you should start by (1) splitting README into separate documents and (2) moving the copyright boilerplate out of the docstrings. Maybe with that, it'd become clearer how to structure the docs. And then, maybe you'd use the |
Can you expand on why do they fail. What's unique about keeping docs out of source code that will makes it click. How I look at it is, keeping doc/source separate is an overhead. As a natural habit, I always write doc-strings within source files, including examples/abstracts etc |
Thank you will give this a try. I want to see how to cut out separate markdowns based upon module doc string. Then class/function level doc-string continues to serve as internal API doc, while module doc-string can act as end user doc. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
That may happen if pip is quite old IIRC. |
In my case, it was just a matter of overriding
|
Oh, so you needed to solve building wheels from source without having an intermediate sdist first. Makes sense. I would probably also take into account pre-built files (for building from an sdist that already contains these) — so this step could be skipped if the cache is valid. |
Today I am trying to make a release because we had a fix in 2.4.0. For some reason I am reaching out to see in case you have already ran into this issue elsewhere. Worst, this is not reproducible locally, I tried |
Looks like removing |
Sorry, I'm a bit preoccupied with the russian fascist terrorists invading my country (see https://github.com/vshymanskyy/StandWithUkraine for more information) and trying to help my mom and one of the brothers get out of the harm's way. But when I'll have a minute to distract myself from that, I'll try to add comments regarding the problems you've been seeing. |
@webknjaz No worries at all Sviatoslav. We all stand in support with Ukraine. I'll also add the badge within our repo here. PS: I was able to resolve the errors (by upgrading build deps) and made a release yesterday. |
@webknjaz Hi Sviatoslav Sydorenko, hope you are doing well. I recently observed the dist step has started failing. I am curious if this is something you are observing across other repositories too? Find below screenshot from one of the recent run. Somehow the wheel package is missing version info resulting in dist step failure. Afaik, nothing significant has been changed in the code. Looking forward to your thoughts. |
Interesting... On line 960 in your screenshot it clearly shows that the wheel that's been generated got a version |
Looks like it may be this bug: pypa/setuptools-scm#727. It seems like v7.0.3 is supposed to get released with a fix some day. The root reason seams to be pypa/setuptools-scm#580 which got into v7+. So maybe just add |
Thank you @webknjaz |
@webknjaz I have run into fever this past week :(. Just wanted to leave an update that I'll take a look at windows related issues (sorry, I lost track of original issue where you last commented, so posting an update here) over the coming weekend. Best. |
I see that currently
setup.py
is being used and called directly. This is highly discouraged and is deprecated. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for more details.It's quite easy to upgrade it to use PEP 517 with invocations via pypa/pip and pypa/build.
If you're open to improvements, I could try to find some time to contribute some packaging and CI/CD-related PRs.
The text was updated successfully, but these errors were encountered: