Skip to content

Commit

Permalink
Merge pull request #121 from timvink/toml
Browse files Browse the repository at this point in the history
Update to pyproject.toml structure
  • Loading branch information
timvink authored Sep 12, 2024
2 parents d876f02 + 122b172 commit 319398b
Show file tree
Hide file tree
Showing 27 changed files with 133 additions and 64 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ jobs:
pip install setuptools wheel twine
- name: Make sure unit tests succeed
run: |
pip install -r tests/test_requirements.txt
pip install .
pip install ".[dev]""
pytest
- name: Build package
run: |
python setup.py sdist bdist_wheel
python -m build
# See https://docs.pypi.org/trusted-publishers/using-a-publisher/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ jobs:
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Static code checking with pyflakes
run: |
pip install pyflakes
pyflakes mkdocs_print_site_plugin
- name: Generate coverage report
run: |
pip install -r tests/test_requirements.txt
pip install .
pytest --cov=mkdocs_print_site_plugin --cov-report=xml
pip install ".[dev]"
pytest --cov=mkdocs_print_site_plugin --cov-report=xml
7 changes: 1 addition & 6 deletions .github/workflows/unittests_codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Static code checking with pyflakes
run: |
pip install pyflakes
pyflakes mkdocs_print_site_plugin
- name: Generate coverage report
run: |
pip install -r tests/test_requirements.txt
pip install .
pip install ".[dev]"
pytest --cov=mkdocs_print_site_plugin --cov-report=xml -vvv
- name: Upload coverage to Codecov
if: "contains(env.USING_COVERAGE, matrix.python-version)"
Expand Down
Empty file.
119 changes: 119 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
[build-system]
requires = ["setuptools>=70.0", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"

[project.entry-points."mkdocs.plugins"]
"print-site" = "mkdocs_print_site_plugin.plugin:PrintSitePlugin"

[project]
name="mkdocs-print-site-plugin"
keywords = ["mkdocs", "plugin","print","pdf"]
authors = [
{ name = "Tim Vink", email = "vinktim@gmail.com" }
]
license = { text = "MIT" }

description="MkDocs plugin that combines all pages into one, allowing for easy export to PDF and standalone HTML."
readme = { file = "README.md", content-type = "text/markdown" }

requires-python=">=3.8"

classifiers=[
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
"Topic :: Documentation",
"Topic :: Text Processing",
]

dynamic = ["version","dependencies","optional-dependencies"]

[project.urls]
"Homepage" = "https://github.com/timvink/mkdocs-print-site-plugin"

[tool.setuptools.dynamic]
version = {attr = "mkdocs_print_site_plugin.__version__"}

dependencies={file = ["requirements.txt"]}

optional-dependencies.dev={file = ["requirements_dev.txt"]}
optional-dependencies.base={file = ["requirements.txt"]}
optional-dependencies.all={file = ["requirements.txt", "requirements_dev.txt"]}

[tool.pytest.ini_options]
markers = [
"integration: marks tests as integration, meaning they use databases (deselect with '-m \"not integration\"')",
"serial",
"no_temp_caching",
]

# https://github.com/charliermarsh/ruff
[tool.ruff]

# Rules to apply
lint.select= ["E", "F", "I", "UP"]

# Exclude rules
lint.ignore = ['D104'
,'D212'
,'D200'
,'D412'
,'E731'
,'E501'
,'E722'
,'D104'
,'E402'
,"UP038" # UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)`
]

# Exclude files in tests dir
lint.exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]

# Set line length, keep same as black
line-length = 120

extend-exclude = [
"*.yml",
"*.toml",
"*.md",
".json",
"Makefile",
"*.txt",
]

#supported for python 3.10
target-version = "py310"

# Always autofix
fix = true

[tool.uv]
dev-dependencies = [
"ruff",
]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mkdocs-material>=7.3.0
10 changes: 6 additions & 4 deletions tests/test_requirements.txt → requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
mkdocs
mkdocs-material
pyflakes
mkdocs-git-revision-date-localized-plugin
# building the package
build
# testing
pytest
pytest-cov
click
# docs
mkdocs-git-revision-date-localized-plugin
# testing for compatibility
mkdocs-windmill
mkdocs-img2fig-plugin
mkdocs-charts-plugin
mkdocs-charts-plugin
44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions src/mkdocs_print_site_plugin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2.6.0"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 319398b

Please sign in to comment.