Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 488a9d9

Browse files
authored
Replace setup.py with pyproject.toml (#138)
1 parent d6ce8a2 commit 488a9d9

5 files changed

Lines changed: 298 additions & 36 deletions

File tree

.github/workflows/tests.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v3
12-
- uses: actions/setup-python@v4
12+
- name: Install uv
13+
uses: astral-sh/setup-uv@v5
1314
with:
14-
python-version: 3.x
15-
- run: |
16-
which uv || python -m pip install uv
15+
version: "latest"
16+
- name: Run tests
17+
run: |
1718
./test.sh

pyproject.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,42 @@
1+
[project]
2+
name = "mypy_primer"
3+
version = "0.1.0"
4+
authors = [{ name = "Shantanu Jain" }, { email = "[email protected]" }]
5+
description = "Run mypy over millions of lines of code"
6+
readme = "README.md"
7+
requires-python = ">=3.10"
8+
license = {file = "LICENSE"}
9+
classifiers = [
10+
"Intended Audience :: Developers",
11+
"License :: OSI Approved :: MIT License",
12+
"Operating System :: OS Independent",
13+
"Programming Language :: Python :: 3",
14+
"Topic :: Software Development",
15+
]
16+
17+
[project.urls]
18+
homepage = "https://github.com/hauntsaninja/mypy_primer"
19+
repository = "https://github.com/hauntsaninja/mypy_primer"
20+
21+
[project.scripts]
22+
mypy_primer = "mypy_primer.main:main"
23+
24+
[dependency-groups]
25+
dev = [
26+
"black>=25.1.0",
27+
"flake8>=7.1.2",
28+
"isort>=6.0.1",
29+
"mypy>=1.15.0",
30+
]
31+
132
[tool.black]
233
line-length = 100
334

435
[tool.isort]
536
profile = "black"
637
line_length = 100
738
skip_gitignore = true
39+
40+
[build-system]
41+
requires = ["setuptools"]
42+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

test.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
set -ex
22

3-
uv pip install isort black flake8 mypy --python $(which python)
4-
isort --diff --check --quiet .
5-
black --diff --check --quiet .
6-
flake8 --max-line-length=100 --ignore=E203,E501,W503 $(git ls-files | grep "py$")
7-
mypy -p mypy_primer --strict --python-version 3.10
3+
uv run isort --diff --check --quiet .
4+
uv run black --diff --check --quiet .
5+
uv run flake8 --max-line-length=100 --ignore=E203,E501,W503 $(git ls-files | grep "py$")
6+
uv run mypy -p mypy_primer --strict --python-version 3.10
87
# check we have unique projects
9-
python -c 'from mypy_primer.projects import get_projects; get_projects()'
8+
uv run python -c 'from mypy_primer.projects import get_projects; get_projects()'
109
# this check was meant to ensure we could programmatically update the projects
1110
# i've disabled for now, i think it's nice to be able to e.g. add inline comments
1211
# we can re-enable if we remove that limitation or if we have a strong need

0 commit comments

Comments
 (0)