-
Notifications
You must be signed in to change notification settings - Fork 149
pyproject definition #1067
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
pyproject definition #1067
Conversation
|
Unfortunately I haven't found a meaningful way to get rid of env_climada.yml too. e.g. a script that translates and exports the content of pyproject.toml to the env_climada.yml file: |
|
What about this? https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata We can place the contents of [project]
dynamic = ["dependencies"]
# ...
[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}This is still considered a beta feature, but we could give it a try. Of course, the
|
| dev = [ | ||
| "ipython", | ||
| "myst-nb", | ||
| "readthedocs-sphinx-ext>=2.2", | ||
| "sphinx", | ||
| "sphinx-book-theme", | ||
| "sphinx-markdown-tables", | ||
| "sphinx-design", | ||
| "sphinx-mdinclude", | ||
| "mccabe>=0.6", | ||
| "pylint>=3.0", | ||
| "pytest", | ||
| "pytest-cov", | ||
| "pytest-subtests", | ||
| "pre-commit" | ||
| ] |
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 is very inconvenient. I think we should omit the "dev" shortcut then instead of duplicating the lists.
After personal discussion, this does not seem feasible. Packages on conda-forge may have different names than on PyPI. The conda environment file also serves a slightly different purpose (creating a conda environment) than the pyproject.toml (check that requirements are met). |
pyproject.toml
Outdated
| description = "CLIMADA in Python" | ||
| readme = "README.md" | ||
| requires-python = ">=3.10,<3.13" | ||
| license = { text = "GNU Lesser General Public License v3 (GPLv3)" } |
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.
| license = { text = "GNU Lesser General Public License v3 (GPLv3)" } | |
| license = { text = "GNU General Public License v3 (GPLv3)" } |
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.
Good catch!
pyproject.toml
Outdated
| [project] | ||
| name = "climada" | ||
| version = "6.0.2-dev" | ||
| description = "CLIMADA in Python" |
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.
| description = "CLIMADA in Python" | |
| description = "Framework for climate risk assessment and adaptation option appraisal" |
pyproject.toml
Outdated
| @@ -1,3 +1,106 @@ | |||
| [build-system] | |||
| requires = ["setuptools >= 64"] | |||
| requires = ["setuptools>=61", "setuptools_scm"] | |||
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.
Why reduce the version requirement for setuptools?
Why include setuptools_scm? According to its docs:
setuptools-scm extracts Python package versions from git or hg metadata instead of declaring them as the version argument or in a Source Code Managed (SCM) managed file.
We hard-code the version in this file later on, so including this requirement serves no purpose (or does 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.
👍 changes reverted
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.
turns out we actually need setuptools_scm for including package data
pyproject.toml
Outdated
| "pytest", | ||
| "pytest-cov", | ||
| "pytest-subtests", | ||
| "pre-commit" |
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.
"pre-commit" is neither part of test nor of doc
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.
I've renamed test to dev and added pre-commit
…efinition' into feature/pyproject-definition
Changes proposed in this PR:
This PR fixes #984 #1009
PR Author Checklist
develop)PR Reviewer Checklist