-
Notifications
You must be signed in to change notification settings - Fork 668
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
🔧 MAINTAIN: Move to flit for PEP 621 package builds #1645
Conversation
I would also just move to flit and remove setup.cfg and MANIFEST.in |
@chrisjsewell have you found any nice tutorials on that? I'm happy to give it a try but it'd be a first for me. I guess the process would basically be:
is that right? |
Codecov Report
@@ Coverage Diff @@
## master #1645 +/- ##
=======================================
Coverage 91.30% 91.30%
=======================================
Files 7 7
Lines 690 690
=======================================
Hits 630 630
Misses 60 60
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
Well just the flit documentation should be mainly all you need, you can also try https://ini2toml.readthedocs.io/en/latest/readme.html, and I've already done this in e.g. aiidateam/aiida-core#5312 |
the This would also need updating, but wouldn't be too hard: https://github.com/executablebooks/jupyter-book/blob/abf118388834b2c97ec74aac4fae095e35481a19/.pre-commit-config.yaml#L36-L49 |
will try to give it a shot tonight and ping you if anything comes up |
pyproject.toml
Outdated
"docutils>=0.15,<0.18", | ||
"jsonschema<4", | ||
# Include Jupytext to ensure users have the right version, even if not strictly necessary | ||
"jupytext>=1.11.2,<1.12", # markdown-it-py~=1 required and support from 1.11.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An aside - I noticed that we're pinning jupytext on a minor version rather than a major version. It's now on release 1.13.7
- do we still need to keep this pin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we kind of don't need the jupytext dependency at all.
The lower pin was added when markdown-it-py was only an extra of jupytext, so you could end up with non-matching versions, and jupytext would just fail to convert properly.
But now, markdown-it-py is a first-class dependency of jupytext: https://github.com/mwouts/jupytext/blob/8cfa66bef380bf6d54479a06b092da30dbc9a7c4/setup.py#L38
OK I believe that I got a working |
pyproject.toml
Outdated
build-backend = "flit_core.buildapi" | ||
|
||
[project] | ||
name = "jupyter_book" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only "concern" of this name change, from jupyter-book
to jupyter_book
, is that although pip treats them the same (normalising -
and _
), conda for example does not. So I'm not sure if there would definitely not be any issue.
You can keep the name as jupyter-book
, and set the module name separately, with:
[tool.flit.module]
name = "jupyter_book"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah perfect, will do this.
Apart from two comments, looks good 👍 |
OK I addressed both comments w/ the changes suggested. Jupytext is now in our There's also some functionality that requires Jupytext within jupyter book, but we gave some nice warning messages about it: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This removes our
setup.py
file, which we had marked for removal once pypa/packaging-problems#256 was resolved (and it is now resolved!)I also updated a couple of action jobs since we needed to update our build distribution action.
I tested
pip install -e .
locally withoutsetup.py
and it seemed to work as expected. Will leave this open for a few days in case others think this is not a good action to take yet.