-
Notifications
You must be signed in to change notification settings - Fork 20
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
Switch to pyproject.toml
#240
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
99bb35e
Switch to `pyproject.toml`
MetRonnie a28e52f
Add pytest-xdist as test dependency & improve GH Actions
MetRonnie a59c119
Support python 3.12
MetRonnie 438cd7e
Consolidate pytest & bandit configs into `pyproject.toml`
MetRonnie 5c9ef36
Coverage: improve exclusions
MetRonnie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build | ||
|
||
# build the project whenever the configuration is changed | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- 'README.md' # check markdown is valid | ||
- 'MANIFEST.in' # check packaging | ||
- 'pyproject.toml' # check build config | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
FORCE_COLOR: 2 | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-latest'] | ||
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] | ||
include: | ||
- os: 'macos-latest' | ||
python: '3.7' | ||
name: ${{ matrix.os }} py-${{ matrix.python }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Build | ||
uses: cylc/release-actions/build-python-package@v1 | ||
with: | ||
check-dependencies: false | ||
|
||
- name: Inspect | ||
run: | | ||
unzip -l dist/*.whl | tee files | ||
grep 'metomi/isodatetime/data.py' files | ||
grep 'metomi_isodatetime.*.dist-info/LICENSE' files | ||
# grep 'metomi/isodatetime/py.typed' files # (not yet added) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Copyright (C) British Crown (Met Office) & Contributors. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
[build-system] | ||
requires = ["setuptools >= 49.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
|
||
[project] | ||
name = "metomi-isodatetime" | ||
authors = [ | ||
{name = "Met Office", email = "[email protected]"} | ||
] | ||
description = "Python ISO 8601 date time parser and data model/manipulation utilities" | ||
license = {text = "LGPLv3"} | ||
readme = "README.md" | ||
keywords = ["isodatetime", "datetime", "iso8601", "date", "time", "parser"] | ||
requires-python = ">=3.7" | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Other Environment", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Utilities" | ||
] | ||
dynamic = ["version"] | ||
|
||
|
||
[project.urls] | ||
Homepage = "https://github.com/metomi/isodatetime" | ||
Repository = "https://github.com/metomi/isodatetime" | ||
Changelog = "https://github.com/metomi/isodatetime/blob/master/CHANGES.md" | ||
|
||
|
||
[tool.setuptools] | ||
platforms = ["any"] | ||
|
||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "metomi.isodatetime.FULL_VERSION"} | ||
|
||
|
||
[tool.setuptools.packages.find] | ||
include = ["metomi*"] | ||
exclude = ["metomi.isodatetime.tests*"] | ||
|
||
|
||
[tool.setuptools.package-data] | ||
"metomi.isodatetime" = ["py.typed"] | ||
|
||
|
||
[project.scripts] | ||
isodatetime = "metomi.isodatetime.main:main" | ||
|
||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"coverage", | ||
"pytest>=6", | ||
"pytest-env", | ||
"pytest-cov", | ||
"pytest-xdist", | ||
"flake8", | ||
"bandit>=1.7.1", | ||
] | ||
all = [ | ||
"metomi-isodatetime[test]", | ||
] | ||
|
||
|
||
[tool.pytest.ini_options] | ||
addopts = "-v -s -ra --color=auto --doctest-glob='*.md' -m 'not slow'" | ||
markers = [ | ||
"slow: mark a test as slow - it will be skipped by default (use '-m \"slow or not slow\"' to run all tests)" | ||
] | ||
testpaths = [ | ||
"metomi/isodatetime/tests", | ||
"README.md", | ||
] | ||
|
||
|
||
[tool.bandit] | ||
exclude_dirs = ["metomi/isodatetime/tests"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we need this bit?
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.
coverage xml
- I think this is needed to convert the data into a compatible format for Codecov? But not sure.coverage report
- Not strictly needed but can be useful to see the coverage stats sometimes