Skip to content

Commit

Permalink
Merge pull request #47 from daniel-mizsak/feature/add-best-practices
Browse files Browse the repository at this point in the history
Implement new best practices
  • Loading branch information
daniel-mizsak authored Aug 10, 2024
2 parents 365c3c3 + 0d6f0e3 commit 6edc75a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 37 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Daniel Mizsak
Copyright (c) 2024 Daniel Mizsak

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion docs/add_five.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ To increment the value of a number by five, use the `add_five` function.
Description of the `add_five` function:
---------------------------------------

.. autofunction:: python_package_template.main.add_five
.. autofunction:: python_package_template.add_five
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ This is a template repository for my python packages.
:hidden:

add_five
subtract_three
19 changes: 19 additions & 0 deletions docs/subtract_three.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Subtract three
========

Example call
------------

To decrement the value of a number by three, use the `subtract_three` function.

.. code-block:: python
from python_package_template import subtract_three
print(subtract_three(8))
Description of the `subtract_three` function:
---------------------------------------

.. autofunction:: python_package_template.subtract_three
70 changes: 35 additions & 35 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
# Build System
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
requires = ["hatchling"]
build-backend = "hatchling.build"

# Project Metadata
[project]
name = "python-package-template-pypi" # Name has to be unique on pypi.
version = "0.1.0"
description = "A github template with my python package configurations."
readme = "README.md"
requires-python = ">=3.11"
license = { file = "LICENSE" }
authors = [{ name = "Daniel Mizsak", email = "[email protected]" }]
keywords = ["python", "template", "package", "github", "pypi"]
classifiers = [
name = "python-package-template-pypi" # Name has to be unique on pypi.
version = "0.1.1"
description = "A github template with my python package configurations."
readme = "README.md"
requires-python = ">=3.11"
license = { file = "LICENSE" }
authors = [{ name = "Daniel Mizsak", email = "[email protected]" }]
keywords = ["python", "template", "package", "github", "pypi"]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = []
[project.optional-dependencies]
dev = ["hatch", "mypy", "pre-commit", "pytest-cov", "pytest", "ruff", "tox"]
docs = ["furo", "sphinx", "sphinx-copybutton"]
]
dependencies = []
[project.optional-dependencies]
dev = ["hatch", "mypy", "pre-commit", "pytest-cov", "pytest", "ruff", "tox"]
docs = ["furo", "sphinx", "sphinx-copybutton"]

[project.scripts]
ppt = "python_package_template.cli:main"
[project.scripts]
ppt = "python_package_template.cli:main"

[project.urls]
Documentation = "https://python-package-template-pypi.readthedocs.io/en/latest/"
Homepage = "https://pythonvilag.hu/"
Issues = "https://github.com/daniel-mizsak/python-package-template/issues"
Repository = "https://github.com/daniel-mizsak/python-package-template"
[project.urls]
Documentation = "https://python-package-template-pypi.readthedocs.io/en/latest/"
Homepage = "https://pythonvilag.hu/"
Issues = "https://github.com/daniel-mizsak/python-package-template/issues"
Repository = "https://github.com/daniel-mizsak/python-package-template"

# Tools
# Hatch
[tool.hatch.build.targets.wheel]
packages = ["src/python_package_template"]
packages = ["src/python_package_template"]

# MyPy
[tool.mypy]
ignore_missing_imports = true
pretty = true
show_column_numbers = true
show_error_context = true
strict = true
warn_unreachable = true
warn_unused_ignores = true
ignore_missing_imports = true
pretty = true
show_column_numbers = true
show_error_context = true
strict = true
warn_unreachable = true
warn_unused_ignores = true

# Pytest
[tool.pytest.ini_options]
addopts = "--cov=python_package_template --cov=tests --cov-config=pyproject.toml --cov-report=term-missing --cov-report=html --cov-report=xml"
testpaths = ["tests"]
addopts = "--cov=python_package_template --cov=tests --cov-config=pyproject.toml --cov-report=term-missing --cov-report=html --cov-report=xml"
testpaths = ["tests"]

# Coverage
[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:", "if __name__ == '__main__':"]
omit = ["**/__main__.py"]
exclude_also = ["if TYPE_CHECKING:", "if __name__ == '__main__':"]
omit = ["**/__main__.py"]

0 comments on commit 6edc75a

Please sign in to comment.