Skip to content

Commit

Permalink
Put dev dependencies to pyproject.toml and auto-generate requirements…
Browse files Browse the repository at this point in the history
…-dev.txt
  • Loading branch information
Akuli committed Nov 1, 2023
1 parent 3c5a938 commit d159dc3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ jobs:
- run: python3 -m pyupgrade $(cat filelist.txt) --keep-runtime-typing --py38-plus --exit-zero-even-if-changed
- run: python3 -m black $(cat filelist.txt)
- run: python3 -m isort $(cat filelist.txt)
# I like requirements-dev.txt and some other people like pyproject.toml, so we have both.
# Auto-generating is the easiest way to ensure the two stay in sync.
- run: |
echo "# Auto-generated in GitHub Actions. See autofix.yml." > pr/requirements-dev.txt
python3 -c 'if True:
import tomli
with open("pr/pyproject.toml", "rb") as f:
content = tomli.load(f)
for dep in content["project"]["optional-dependencies"]["dev"]:
print(dep)
' >> pr/requirements-dev.txt
- uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: ./pr
Expand Down
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,33 @@ dependencies = [
"sv-ttk>=2.5.5",
]

[project.optional-dependencies]
dev = [
"pytest==6.2.5",
"pytest-cov==4.0.0",
"pytest-mock==3.10.0",
"pycln==2.1.3",
"black==23.1.0",
"isort==5.12.0",
"pyupgrade==3.9.0",
"sphinx>=4.0.0, <5.0.0",
"pillow>=5.4.1",
"requests>=2.24.0, <3.0.0",

# type checking, exact versions to avoid "works on my computer" problems
"mypy==1.1.1",
"types-Pygments==2.14.0.6",
"types-docutils==0.19.1.6",
"types-Send2Trash==1.8.2.4",
"types-setuptools==67.6.0.5",
"types-colorama==0.4.15.8",
"types-toposort==1.10.0.0",
"types-psutil==5.9.5.10",
"types-PyYAML==6.0.12.8",
"types-tree-sitter==0.20.1.2",
"types-tree-sitter-languages==1.5.0.2",
]

[project.scripts]
porcu = "porcupine.__main__:main"
porcupine = "porcupine.__main__:main"

0 comments on commit d159dc3

Please sign in to comment.