This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from alexwlchan/basic-template
Add a very basic empty Python project
- Loading branch information
Showing
9 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -e . | ||
pip install -r dev_requirements.txt | ||
- name: Run linting | ||
run: | | ||
black --check . | ||
# E501 = line too long; anything up to 100-ish is fine in my book | ||
# (the "ish" is intentional; see https://www.youtube.com/watch?v=wf-BqAjZb8M) | ||
# | ||
# E203/W503/W504 = this is where black and flake8 conflict, | ||
# see https://black.readthedocs.io/en/stable/faq.html#why-are-flake8-s-e203-and-w503-violated | ||
flake8 --ignore=E501,E203,W503 --extend-select=W504 | ||
- name: Check types | ||
run: mypy src tests | ||
|
||
- name: Run tests | ||
run: | | ||
coverage run -m pytest tests | ||
coverage report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.coverage | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-r requirements.txt | ||
|
||
black | ||
coverage | ||
flake8 | ||
mypy | ||
pip-tools | ||
pytest | ||
pytest-cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.12 | ||
# by the following command: | ||
# | ||
# pip-compile dev_requirements.in | ||
# | ||
black==23.12.1 | ||
# via -r dev_requirements.in | ||
build==1.0.3 | ||
# via pip-tools | ||
click==8.1.7 | ||
# via | ||
# black | ||
# pip-tools | ||
coverage[toml]==7.4.0 | ||
# via | ||
# -r dev_requirements.in | ||
# pytest-cov | ||
flake8==7.0.0 | ||
# via -r dev_requirements.in | ||
iniconfig==2.0.0 | ||
# via pytest | ||
mccabe==0.7.0 | ||
# via flake8 | ||
mypy==1.8.0 | ||
# via -r dev_requirements.in | ||
mypy-extensions==1.0.0 | ||
# via | ||
# black | ||
# mypy | ||
packaging==23.2 | ||
# via | ||
# black | ||
# build | ||
# pytest | ||
pathspec==0.12.1 | ||
# via black | ||
pip-tools==7.3.0 | ||
# via -r dev_requirements.in | ||
platformdirs==4.1.0 | ||
# via black | ||
pluggy==1.3.0 | ||
# via pytest | ||
pycodestyle==2.11.1 | ||
# via flake8 | ||
pyflakes==3.2.0 | ||
# via flake8 | ||
pyproject-hooks==1.0.0 | ||
# via build | ||
pytest==7.4.4 | ||
# via | ||
# -r dev_requirements.in | ||
# pytest-cov | ||
pytest-cov==4.1.0 | ||
# via -r dev_requirements.in | ||
typing-extensions==4.9.0 | ||
# via mypy | ||
wheel==0.42.0 | ||
# via pip-tools | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
# pip | ||
# setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools >= 65", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "hotchocolate" | ||
authors = [ | ||
{name = "Alex Chan", email="alex@alexwlchan.net"}, | ||
] | ||
requires-python = ">=3.12" | ||
dynamic = ["dependencies", "version"] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/alexwlchan/hot-chocolate" | ||
|
||
[project.scripts] | ||
hotchocolate = "hotchocolate.cli:main" | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = {file = ["requirements.txt"]} | ||
version = {attr = "hotchocolate.__version__"} | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
|
||
[tool.setuptools.package-data] | ||
hotchocolate = ["static/*", "templates/*"] | ||
|
||
[tool.coverage.run] | ||
branch = true | ||
source = [ | ||
"hotchocolate", | ||
"tests", | ||
] | ||
|
||
[tool.coverage.report] | ||
show_missing = true | ||
skip_covered = true | ||
fail_under = 100 | ||
|
||
[tool.pytest.ini_options] | ||
filterwarnings = ["error"] | ||
|
||
[tool.mypy] | ||
mypy_path = "src" | ||
check_untyped_defs = true | ||
disallow_any_generics = true | ||
disallow_incomplete_defs = true | ||
disallow_subclassing_any = true | ||
disallow_untyped_calls = true | ||
disallow_untyped_decorators = true | ||
disallow_untyped_defs = true | ||
no_implicit_optional = true | ||
no_implicit_reexport = true | ||
show_error_codes = true | ||
strict_equality = true | ||
warn_redundant_casts = true | ||
warn_return_any = true | ||
warn_unused_configs = true | ||
warn_unused_ignores = true |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.12 | ||
# by the following command: | ||
# | ||
# pip-compile | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "2024.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from hotchocolate import __version__ | ||
|
||
|
||
def test_version() -> None: | ||
assert __version__ == "2024.1" | ||
|
||
|
||
def test_truth() -> None: | ||
assert True |