Skip to content

Commit 24a2cbe

Browse files
committed
refactor(project): use pyproject.toml for dependencies
1 parent 4c554f8 commit 24a2cbe

File tree

6 files changed

+46
-9
lines changed

6 files changed

+46
-9
lines changed

.devcontainer/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ RUN python -m pip install --upgrade pip
1515

1616
WORKDIR /home/$USER/customer-success
1717

18+
COPY pyproject.toml pyproject.toml
19+
RUN pip install -e .[dev, qr_codes]
20+
1821
COPY docs/requirements.txt docs/requirements.txt
1922
RUN pip install -r docs/requirements.txt
20-
21-
COPY qr_codes/requirements.txt qr_codes/requirements.txt
22-
RUN pip install -r qr_codes/requirements.txt

.devcontainer/devcontainer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"ms-python.python",
2626
"ms-python.black-formatter",
2727
"ms-python.flake8",
28-
"SimonSiefke.svg-preview"
28+
"SimonSiefke.svg-preview",
29+
"tamasfe.even-better-toml"
2930
]
3031
}
3132
}

.github/workflows/generate-qr-code.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ jobs:
4545
with:
4646
python-version: "3.11"
4747
cache: pip
48-
cache-dependency-path: "qr_codes/requirements.txt"
48+
cache-dependency-path: "pyproject.toml"
4949

5050
- name: Install dependencies
51-
run: pip install -r qr_codes/requirements.txt
51+
run: pip install -e .[qr_codes]
5252

5353
- name: Generate QR code
5454
run: |

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
2+
*.egg-info
23
qr_codes/*.png
34
!qr_codes/calitp.org.png

pyproject.toml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[project]
2+
name = "customer-success"
3+
description = "Administrative tasks for Cal-ITP's Customer Success team"
4+
version = "1.0.0"
5+
readme = "README.md"
6+
license = { file = "LICENSE" }
7+
classifiers = ["Programming Language :: Python :: 3 :: Only"]
8+
requires-python = ">=3.11"
9+
dependencies = []
10+
11+
[project.urls]
12+
code = "https://github.com/cal-itp/customer-success"
13+
tracker = "https://github.com/cal-itp/customer-success/issues"
14+
15+
[project.optional-dependencies]
16+
dev = [
17+
"black",
18+
"build",
19+
"flake8",
20+
"pre-commit"
21+
]
22+
qr_codes = [
23+
"pypng==0.20220715.0",
24+
"qrcode[pil]==7.4.2",
25+
"typing_extensions==4.10.0"
26+
]
27+
28+
[build-system]
29+
requires = ["setuptools>=65"]
30+
build-backend = "setuptools.build_meta"
31+
32+
[tool.black]
33+
line-length = 127
34+
target-version = ['py311']
35+
include = '\.pyi?$'
36+
37+
[tool.setuptools]
38+
packages = []

qr_codes/requirements.txt

-3
This file was deleted.

0 commit comments

Comments
 (0)