Skip to content

Commit c9ee60d

Browse files
Merge pull request #2860 from MetRonnie/pyproject-toml
`setup.cfg` -> `pyproject.toml`
2 parents b8c6c3b + 192cd81 commit c9ee60d

File tree

6 files changed

+222
-158
lines changed

6 files changed

+222
-158
lines changed

.github/workflows/2_auto_publish_release.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ jobs:
2929
- name: Setup Python
3030
uses: actions/setup-python@v5
3131
with:
32-
# return to 3.x once cylc-flow is compatible with 3.10+ (pyuv)
33-
python-version: '3.9'
32+
python-version: '3.x'
3433

3534
- name: Get the version number
3635
uses: cylc/release-actions/stage-2/get-version-from-pr@v1

.github/workflows/build.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build
2+
3+
# build the project whenever the configuration is changed
4+
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
paths:
9+
- 'README.md' # check markdown is valid
10+
- 'MANIFEST.in' # check packaging
11+
- 'pyproject.toml' # check deps and project config
12+
- '.gitignore'
13+
- '.github/workflows/build.yml'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
defaults:
20+
run:
21+
shell: bash -leo pipefail {0}
22+
23+
env:
24+
FORCE_COLOR: 2
25+
PIP_PROGRESS_BAR: off
26+
27+
jobs:
28+
build:
29+
runs-on: ${{ matrix.os }}
30+
timeout-minutes: 10
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os: ['ubuntu-latest', 'macos-latest']
35+
python: ['3.7', '3.8', '3.9', '3']
36+
exclude:
37+
- os: 'macos-latest'
38+
python: '3.7'
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: Configure Python
44+
uses: mamba-org/setup-micromamba@v2
45+
with:
46+
cache-environment: true
47+
post-cleanup: 'all'
48+
environment-name: rose-build
49+
create-args: >-
50+
python=${{ matrix.python }}
51+
52+
- name: Build
53+
uses: cylc/release-actions/build-python-package@v1
54+
55+
- name: Inspect
56+
run: |
57+
unzip -l dist/*.whl | tee files
58+
grep 'metomi_rose.*.dist-info/COPYING' files
59+
grep 'metomi/rose/etc' files
60+
grep 'metomi/rosie/lib' files
61+
grep 'metomi/rose/scripts' files
62+
# grep 'metomi/rose/py.typed' files # TODO

.github/workflows/test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ defaults:
3636
run:
3737
shell: bash -c "exec $CONDA_PREFIX/bin/bash -elo pipefail {0}"
3838

39+
env:
40+
FORCE_COLOR: 2
41+
PIP_PROGRESS_BAR: off
42+
3943
jobs:
4044
lint:
4145
strategy:

pyproject.toml

+155
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Copyright (C) British Crown (Met Office) & Contributors.
2+
#
3+
# This file is part of Rose, a framework for meteorological suites.
4+
#
5+
# Rose is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# Rose is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with Rose. If not, see <http://www.gnu.org/licenses/>.
17+
18+
[build-system]
19+
requires = ["setuptools"]
20+
build-backend = "setuptools.build_meta"
21+
22+
[project]
23+
name = "metomi-rose"
24+
description = "Rose, a framework for meteorological suites."
25+
authors = [
26+
{ name = "British Crown (Met Office) & Contributors", email = "[email protected]" }
27+
]
28+
readme = "README.md"
29+
license = { text = "GPL" }
30+
keywords = [
31+
"hpc",
32+
"weather-modelling",
33+
"weather-model",
34+
"meteorological-suites",
35+
"meteorological-modelling",
36+
"meteorological-models",
37+
"workflows",
38+
"workflow-automation",
39+
]
40+
classifiers = [
41+
"Environment :: Console",
42+
"Environment :: Web Environment",
43+
"Intended Audience :: Developers",
44+
"Intended Audience :: System Administrators",
45+
"Intended Audience :: Science/Research",
46+
"Operating System :: POSIX :: Linux",
47+
"Programming Language :: Python :: 3.7",
48+
"Topic :: Scientific/Engineering :: Atmospheric Science"
49+
]
50+
requires-python = ">=3.7"
51+
dynamic = ["version"]
52+
dependencies = [
53+
"aiofiles",
54+
"jinja2>=2.10.1",
55+
"keyring==23.*",
56+
"ldap3",
57+
"metomi-isodatetime==1!3.*",
58+
"psutil>=5.6.0",
59+
"requests",
60+
"sqlalchemy==1.*",
61+
"importlib_metadata>=5.0; python_version < '3.12'",
62+
"importlib_resources>=2.0; python_version < '3.9'"
63+
]
64+
65+
[project.urls]
66+
Homepage = "https://metomi.github.io/rose/doc/html/index.html"
67+
Repository = "https://github.com/metomi/rose"
68+
Changelog = "https://github.com/metomi/rose/blob/master/CHANGES.md"
69+
70+
[project.optional-dependencies]
71+
docs = [
72+
"cylc-sphinx-extensions[all]>=1.2.0",
73+
"hieroglyph>=2.1.0",
74+
"sphinx",
75+
"sphinx_rtd_theme",
76+
"sphinxcontrib-httpdomain",
77+
"sphinxcontrib-svg2pdfconverter"
78+
]
79+
graph = [
80+
"pygraphviz>1.0,!=1.8"
81+
]
82+
tests = [
83+
"aiosmtpd",
84+
"pytest"
85+
# Note: some tests also depend on cylc-rose which has to be the
86+
# development version installed manually (because the latest production
87+
# version is pinned to the previous rose release)
88+
]
89+
lint = [
90+
"flake8>=6.0.0; python_version > '3.7'",
91+
"flake8-type-checking; python_version > '3.7'",
92+
# Upper-pin to last py-3.7-compatible version:
93+
"mypy>=0.800,<1.9",
94+
"types-aiofiles"
95+
]
96+
rosa = []
97+
# disco = [
98+
# TODO: rosie disco has been disabled due to the removal of WSGI support at
99+
# Tornado 6.
100+
# tornado
101+
# ]
102+
all = [
103+
"metomi-rose[lint]",
104+
"metomi-rose[docs]",
105+
"metomi-rose[graph]",
106+
"metomi-rose[tests]",
107+
"metomi-rose[rosa]"
108+
]
109+
110+
[project.scripts]
111+
rose = "metomi.rose.rose:rose"
112+
rosie = "metomi.rose.rose:rosie"
113+
rosa = "metomi.rose.rose:rosa"
114+
115+
[project.entry-points."rose.commands"]
116+
"app-run" = "metomi.rose.app_run:main"
117+
"app-upgrade" = "metomi.rose.upgrade:main"
118+
"check-software" = "metomi.rose.check_software:main"
119+
"config" = "metomi.rose.config_cli:main"
120+
"config-diff" = "metomi.rose.config_diff:main"
121+
"config-dump" = "metomi.rose.config_dump:main"
122+
"date" = "metomi.rose.date_cli:main"
123+
"env-cat" = "metomi.rose.env_cat:main"
124+
"host-select" = "metomi.rose.host_select:main"
125+
"host-select-client" = "metomi.rose.host_select_client:main"
126+
"macro" = "metomi.rose.macro:main"
127+
"metadata-check" = "metomi.rose.metadata_check:main"
128+
"metadata-gen" = "metomi.rose.metadata_gen:main"
129+
"metadata-graph" = "metomi.rose.metadata_graph:main [graph]"
130+
"namelist-dump" = "metomi.rose.namelist_dump:main"
131+
"resource" = "metomi.rose.resource:main"
132+
"task-env" = "metomi.rose.task_env:main"
133+
"task-run" = "metomi.rose.task_run:main"
134+
135+
[project.entry-points."rosie.commands"]
136+
"checkout" = "metomi.rosie.vc:checkout"
137+
"create" = "metomi.rosie.vc:create"
138+
"delete" = "metomi.rosie.vc:delete"
139+
# "disco" = "metomi.rosie.ws:main [disco]"
140+
"go" = "metomi.rosie.browser:main"
141+
"graph" = "metomi.rosie.graph:main [graph]"
142+
"hello" = "metomi.rosie.ws_client_cli:hello"
143+
"id" = "metomi.rosie.suite_id:main"
144+
"lookup" = "metomi.rosie.ws_client_cli:lookup"
145+
"ls" = "metomi.rosie.ws_client_cli:list_local_suites"
146+
147+
[tool.setuptools.packages.find]
148+
include = ["metomi*"]
149+
exclude = ["metomi.rose.tests*", "metomi.rosie.tests*"]
150+
151+
[tool.setuptools]
152+
include-package-data = true
153+
154+
[tool.setuptools.dynamic]
155+
version = { attr = "metomi.rose.__version__" }

setup.cfg

-135
This file was deleted.

setup.py

-21
This file was deleted.

0 commit comments

Comments
 (0)