Skip to content

Commit e65ad60

Browse files
committed
refactor: standardize on pyproject.toml
1 parent 3650645 commit e65ad60

File tree

9 files changed

+48
-51
lines changed

9 files changed

+48
-51
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,11 @@ RUN useradd --create-home --shell /bin/bash $USER && \
1111
# switch to non-root $USER
1212
USER $USER
1313

14+
# enter src directory
15+
WORKDIR /home/$USER/src
16+
1417
# update PATH for local pip installs
1518
ENV PATH "$PATH:/home/$USER/.local/bin"
1619

1720
# update pip
1821
RUN python -m pip install --upgrade pip
19-
20-
# enter src directory
21-
WORKDIR /home/$USER/src
22-
23-
# copy and install packages
24-
COPY . .
25-
RUN pip install -r .devcontainer/requirements.txt
26-
RUN pip install -r tests/requirements.txt

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"service": "dev",
55
"runServices": ["dev"],
66
"workspaceFolder": "/home/compiler/src",
7-
"postAttachCommand": "pip install -e .",
7+
"postCreateCommand": "pip install -e .[dev]",
88
// Set *default* container specific settings.json values on container create.
99
"settings": {
1010
"terminal.integrated.defaultProfile.linux": "bash",
@@ -16,6 +16,7 @@
1616
},
1717
// Add the IDs of extensions you want installed when the container is created.
1818
"extensions": [
19+
"bungcip.better-toml",
1920
"eamodio.gitlens",
2021
"esbenp.prettier-vscode",
2122
"mhutchie.git-graph",

.devcontainer/requirements.txt

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

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.egg-info

.github/workflows/tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip
26-
pip install -r tests/requirements.txt
27-
pip install -e .
26+
pip install -e .[dev]
2827
2928
- name: Run tests
3029
run: ./tests/run.sh

pyproject.toml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,48 @@
1-
[build-system]
2-
requires = [
3-
"setuptools>=63",
4-
"wheel"
1+
[project]
2+
name = "conventional_pre_commit"
3+
version = "2.1.1"
4+
description = "A pre-commit hook that checks commit messages for Conventional Commits formatting."
5+
readme = "README.md"
6+
license = { file = "LICENSE" }
7+
classifiers = ["Programming Language :: Python :: 3 :: Only"]
8+
keywords = ["git", "pre-commit", "conventional-commits"]
9+
authors = [
10+
{ name = "Compiler LLC", email = "[email protected]" }
511
]
12+
requires-python = ">=3.7"
13+
dependencies = []
14+
15+
[project.urls]
16+
code = "https://github.com/compilerla/conventional-pre-commit"
17+
tracker = "https://github.com/compilerla/conventional-pre-commit/issues"
18+
19+
[project.optional-dependencies]
20+
dev = [
21+
"black",
22+
"build",
23+
"flake8",
24+
"pre-commit",
25+
"pytest",
26+
"pytest-cov"
27+
]
28+
29+
[project.scripts]
30+
conventional-pre-commit = "conventional_pre_commit.hook:main"
31+
32+
[build-system]
33+
requires = ["setuptools>=64", "wheel"]
634
build-backend = "setuptools.build_meta"
735

836
[tool.black]
937
line-length = 127
1038
target-version = ['py310']
1139
include = '\.pyi?$'
40+
41+
[tool.pytest.ini_options]
42+
testpaths = ["tests"]
43+
norecursedirs = [
44+
"*.egg-info",
45+
".git",
46+
".pytest_cache",
47+
".vscode",
48+
]

setup.cfg

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

setup.py

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

tests/requirements.txt

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

0 commit comments

Comments
 (0)