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

Convert packaging lesson to use pyproject.toml instead #235

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

willGraham01
Copy link
Contributor

Closes #234 |

Updates the week 7 notes on packaging to use pyproject.toml rather than setup.py.

Assumes that notebooks are still running on the original directory structure. Also throws in a mention that some major packages might not have switched from setup.py to pyproject.toml: in which case students should see some similarities between the two formats and fields used in each.

Copy link
Member

@dpshelio dpshelio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks! we can go ahead and merge it. Consider the two comments I've made.

ch04packaging/03Packaging.ipynb.py Outdated Show resolved Hide resolved
version="0.1.0",
packages=find_packages(),
)
[tool.setuptools_scm]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this entry?

Copy link
Contributor Author

@willGraham01 willGraham01 Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do - if you depend on setuptools_scm, you need to specify tools.setuptools_scm in the pyproject, even if you want to use the defaults 😢

Though in practice, we're not using dynamic versioning here so we could just remove setuptools_scm from the build-requires, and also remove this line - whichever you prefer. Doing it this way will mean that dynamic versioning will work out of the box and not give any bizarre version-fetch fails. So I threw it in so that students have a template that will work if they do choose to dynamically version in their own projects 😄

Co-authored-by: David Pérez-Suárez <d.perez-suarez@ucl.ac.uk>
@willGraham01 willGraham01 merged commit 11756dc into main Nov 22, 2023
4 checks passed
@willGraham01 willGraham01 deleted the pyproject-notes branch November 22, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to writing packages with pyproject.toml
2 participants