Skip to content

Commit 0093542

Browse files
mambelliMarco Mambelli
authored andcommitted
Packaging with uv and pyproject.toml
1 parent 5577e9e commit 0093542

File tree

3 files changed

+1829
-15
lines changed

3 files changed

+1829
-15
lines changed

.github/workflows/linters.yaml

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,35 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: checkout DE Modules
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222
with:
2323
path: decisionengine_modules
2424

2525
- name: checkout DE Framework
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727
with:
2828
path: decisionengine
2929
repository: HEPCloud/decisionengine
3030

3131
- name: checkout GlideinWMS for python3
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3333
with:
3434
path: glideinwms
3535
repository: glideinWMS/glideinwms
36-
ref: branch_v3_9
36+
# ref: master
3737

38-
- uses: actions/setup-python@v4
38+
- name: Install uv
39+
uses: astral-sh/setup-uv@v5
40+
with:
41+
enable-cache: true
42+
43+
- uses: actions/setup-python@v5
3944
with:
4045
python-version: "3.9"
4146
architecture: "x64"
4247

4348
- name: Cache pip
44-
uses: actions/cache@v3
49+
uses: actions/cache@v4
4550
with:
4651
# This path is specific to Ubuntu
4752
path: ~/.cache/pip
@@ -98,30 +103,35 @@ jobs:
98103
runs-on: ubuntu-latest
99104
steps:
100105
- name: checkout DE Modules
101-
uses: actions/checkout@v3
106+
uses: actions/checkout@v4
102107
with:
103108
path: decisionengine_modules
104109

105110
- name: checkout DE Framework
106-
uses: actions/checkout@v3
111+
uses: actions/checkout@v4
107112
with:
108113
path: decisionengine
109114
repository: HEPCloud/decisionengine
110115

111116
- name: checkout GlideinWMS for python3
112-
uses: actions/checkout@v3
117+
uses: actions/checkout@v4
113118
with:
114119
path: glideinwms
115120
repository: glideinWMS/glideinwms
116-
ref: branch_v3_9
121+
# ref: master
122+
123+
- name: Install uv
124+
uses: astral-sh/setup-uv@v5
125+
with:
126+
enable-cache: true
117127

118-
- uses: actions/setup-python@v4
128+
- uses: actions/setup-python@v5
119129
with:
120130
python-version: "3.9"
121131
architecture: "x64"
122132

123133
- name: Cache pip
124-
uses: actions/cache@v3
134+
uses: actions/cache@v4
125135
with:
126136
# This path is specific to Ubuntu
127137
path: ~/.cache/pip
@@ -150,6 +160,7 @@ jobs:
150160
set -x
151161
cd ${{ github.workspace }}/decisionengine
152162
python3 -m pip install --upgrade pip
163+
python3 -m pip install --upgrade setuptools
153164
python3 -m pip install --upgrade wheel
154165
python3 -m pip install --upgrade pytest
155166
python3 -m pip install --user Cython
@@ -173,9 +184,39 @@ jobs:
173184
cd ${{ github.workspace }}/decisionengine_modules
174185
pylint src/decisionengine_modules/
175186
187+
run_ruff:
188+
name: Run Ruff against code tree
189+
runs-on: ubuntu-latest
190+
steps:
191+
- name: checkout DE Modules
192+
uses: actions/checkout@v4
193+
with:
194+
path: decisionengine_modules
195+
196+
- name: checkout DE Framework
197+
uses: actions/checkout@v4
198+
with:
199+
path: decisionengine
200+
repository: HEPCloud/decisionengine
201+
202+
- name: checkout GlideinWMS for python3
203+
uses: actions/checkout@v4
204+
with:
205+
path: glideinwms
206+
repository: glideinWMS/glideinwms
207+
# ref: master
208+
209+
- uses: actions/setup-python@v5
210+
with:
211+
python-version: "3.9"
212+
architecture: "x64"
213+
214+
- name: Run Ruff
215+
uses: astral-sh/ruff-action@v3
216+
176217
license-check:
177218
name: Run REUSE to check license compliance
178219
runs-on: ubuntu-latest
179220
steps:
180-
- uses: actions/checkout@v3
181-
- uses: fsfe/reuse-action@v1
221+
- uses: actions/checkout@v4
222+
- uses: fsfe/reuse-action@v5

pyproject.toml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,66 @@
11
[build-system]
2-
requires = ["setuptools>=51.2", "wheel", "setuptools_scm[toml]>=6.3.1"]
2+
requires = ["setuptools>=72.1", "wheel", "setuptools_scm[toml]>=6.3.1"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
name = "decisionengine-modules"
7+
dynamic = ["version"]
8+
readme = "README.md"
9+
license = {text ="Apache-2.0"}
10+
requires-python = ">=3.9, <3.13"
11+
authors = [
12+
{ name = "Fermilab" },
13+
]
14+
dependencies = [
15+
"authlib",
16+
"bill-calculator-hep >= 0.1.4",
17+
"boto3 >= 1.17.10",
18+
"cryptography",
19+
#"decisionengine >= 2.0",
20+
"gcs-oauth2-boto-plugin >= 2.7",
21+
"google-api-python-client >= 1.12.8",
22+
"google_auth >= 1.16.0",
23+
"htcondor >= 9.0.0",
24+
"numpy >= 1.19.5, < 2.0.0; python_version >= '3.7'",
25+
"pandas >= 1.5.3, < 2.0.0; python_version >= '3.7'",
26+
"pem",
27+
"PyJWT",
28+
"qcs-api-client >= 0.21.1; python_version >= '3.7'",
29+
"requests >= 2.14.2",
30+
"structlog >= 21.1.0",
31+
"urllib3 >= 1.26.2",
32+
]
33+
34+
[project.optional-dependencies]
35+
develop = [
36+
"coverage >= 6.1.2",
37+
"flake8 >= 6.0.0, < 7.0.0",
38+
"importlib_resources >= 5.1.2; python_version <= '3.8'",
39+
"packaging >= 20.9",
40+
"pylint >= 2.7.4",
41+
"pytest >= 7.0.0, < 8.0",
42+
"pytest-cov >= 2.11.1",
43+
"pytest-xdist[psutil] >= 2.3.0",
44+
"pyyaml >= 5.4.1",
45+
"reuse >= 1.1.2",
46+
"sphinx >= 3.5.3",
47+
"sphinx_rtd_theme >= 0.5.1",
48+
"tabulate >= 0.8.8",
49+
"toml >= 0.10.2",
50+
"wheel >= 0.36.2",
51+
]
52+
production = [
53+
"decisionengine >= 2.0",
54+
]
55+
56+
[project.urls]
57+
# https://packaging.python.org/en/latest/specifications/well-known-project-urls/#well-known-project-urls
58+
homepage = "http://hepcloud.fnal.gov/"
59+
source = "https://github.com/HEPCloud/decisionengine_modules"
60+
documentation = "https://hepcloud.github.io/decisionengine_modules/"
61+
releasenotes = "https://hepcloud.github.io/decisionengine_modules/release_notes.html"
62+
issues = "https://github.com/HEPCloud/decisionengine_modules/issues"
63+
564
[tool.setuptools_scm]
665
write_to = "src/decisionengine_modules/version.py"
766

@@ -35,3 +94,9 @@ dedup_headings = "True"
3594
known_first_party = ["decisionengine", "decisionengine_modules"]
3695
lines_between_types = 1
3796
force_alphabetical_sort_within_sections = "True"
97+
98+
[tool.uv]
99+
environments = [
100+
"sys_platform == 'darwin'",
101+
"sys_platform == 'linux'",
102+
]

0 commit comments

Comments
 (0)