Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #29 from alexwlchan/basic-template
Browse files Browse the repository at this point in the history
Add a very basic empty Python project
  • Loading branch information
alexwlchan committed Jan 24, 2024
2 parents d8fefc6 + e49023d commit 316323b
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.coverage
*.pyc
9 changes: 9 additions & 0 deletions dev_requirements.in
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
63 changes: 63 additions & 0 deletions dev_requirements.txt
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
62 changes: 62 additions & 0 deletions pyproject.toml
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 added requirements.in
Empty file.
6 changes: 6 additions & 0 deletions requirements.txt
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
#
1 change: 1 addition & 0 deletions src/hotchocolate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2024.1"
9 changes: 9 additions & 0 deletions tests/test_truth.py
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

0 comments on commit 316323b

Please sign in to comment.