diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..dd15b37 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,16 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: trailing-whitespace + - id: check-added-large-files + - id: check-ast + - id: check-json + - id: check-merge-conflict + - id: check-xml + - id: check-yaml + args: ['--unsafe'] # needed for !! tags in mkdocs.yml + - id: debug-statements + - id: end-of-file-fixer + - id: mixed-line-ending + args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows diff --git a/CHANGELOG.md b/CHANGELOG.md index dca3a6c..dbbe06e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Version 0.7 + +- Add: Let `git` set remote to the project repository during setup +- Fix: Setting `pymdownx.magiclink` in `mkdocs` correctly. +- Upd: Updated dependencies of environemnts + ## Version 0.6 - Fix: `PIP_COMPILE_UPGRADE_PACKAGE` instead of `PIP_COMPILE_UPGRADE` in `upgrade-pkg` hatch command diff --git a/README.md b/README.md index 4a946de..38c6463 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The Hatchlor integrates the following features: * [pyproject.toml]: all package, build and tool configuration in one file, * [pytest]: full-featured Python testing tool that helps you write better programs, * [coverage]: tool for measuring code coverage of Python programs with pytest integration, -* [GitHub Actions]: workflows with [dependabot], [release-drafter], [labeler], build docs, test & publish to PYPI, +* [GitHub Actions]: workflows with [dependabot], [release-drafter], [labeler], build docs, test & publish to PyPI, * [ruff]: extremely fast Python linter/formatter, which replaces [isort], [flake8], [black], etc., * [mypy]: optional static type checker for Python, * [mkdocs]: a fast, simple and downright gorgeous static site generator, diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 3ae0904..2cb1907 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -4,6 +4,7 @@ subprocess.call(['git', 'init']) subprocess.call(['git', 'add', '*']) subprocess.call(['git', 'commit', '-m', 'Initial commit']) + subprocess.call(['git', 'remote', 'add', 'origin', '{{ cookiecutter.project_repo }}']) except Exception as e: print(f"An error occurred during initializing the git repo: {e}") print("Makre sure to manually set up a git repository which is necessary for `hatch-vcs`") diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 39a5ad4..87df95f 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: check-added-large-files @@ -20,14 +20,14 @@ repos: # Ruff replaces black, flake8, autoflake, isort and more - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.4.4' # make sure this is always consistent with hatch configs + rev: 'v0.5.7' # make sure this is always consistent with hatch configs hooks: - id: ruff - id: ruff-format args: [--check, --config, ./pyproject.toml] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.9.0' # make sure this is always consistent with hatch configs + rev: 'v1.11.1' # make sure this is always consistent with hatch configs hooks: - id: mypy args: ["--install-types", "--non-interactive"] diff --git a/{{cookiecutter.project_slug}}/mkdocs.yml b/{{cookiecutter.project_slug}}/mkdocs.yml index 00bec51..0379659 100644 --- a/{{cookiecutter.project_slug}}/mkdocs.yml +++ b/{{cookiecutter.project_slug}}/mkdocs.yml @@ -132,9 +132,11 @@ markdown_extensions: social_url_shortener: true social_url_shorthand: true normalize_issue_symbols: true - provider: github - user: pypa - repo: hatch + {% set parts = cookiecutter.project_repo.split('/') -%} + {% set domain_parts = parts[-3].split('.') if parts|length > 2 else [] -%} + provider: {{ domain_parts[-2] if domain_parts|length > 2 else 'github' }} + user: {{ parts[-2] if parts|length > 2 else cookiecutter.github_username }} + repo: {{ parts[-1] if parts|length > 2 else cookiecutter.project_slug }} - pymdownx.mark: - pymdownx.progressbar: - pymdownx.saneheaders: diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index ffa1a24..acf387c 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -217,7 +217,7 @@ ban-relative-imports = "all" {%- if cookiecutter.lock_file_support %} [tool.hatch.env] -requires = ["hatch-pip-compile~=1.11.1"] +requires = ["hatch-pip-compile~=1.11.2"] {%- endif %} # Default environment with production dependencies @@ -263,25 +263,25 @@ debug = "cov --no-cov -s --pdb --pdbcls=IPython.core.debugger:Pdb {args}" # Docs environment [tool.hatch.envs.docs] dependencies = [ - "mkdocs~=1.5", + "mkdocs~=1.6", "mkdocs-material[imaging]~=9.4", # Plugins "mkdocs-include-markdown-plugin", "mkdocs-gen-files", "mkdocs-literate-nav", - "mkdocs-minify-plugin~=0.5", + "mkdocs-minify-plugin~=0.8", "mkdocs-section-index", - "mkdocs-git-revision-date-localized-plugin~=1.1", + "mkdocs-git-revision-date-localized-plugin~=1.2", "mkdocstrings[python]", "mkdocs-redirects~=1.2", - "mkdocs-glightbox~=0.3.0", - "mike~=2.0.0", + "mkdocs-glightbox~=0.4.0", + "mike~=2.1", # Extensions - "pymdown-extensions~=10.5", + "pymdown-extensions~=10.9", # Necessary for syntax highlighting in code blocks - "pygments~=2.13", + "pygments~=2.18", # Validation - "linkchecker~=10.3", + "linkchecker~=10.4", ] [tool.hatch.envs.docs.env-vars] SOURCE_DATE_EPOCH = "1580601600" @@ -303,8 +303,8 @@ build-check = [ [tool.hatch.envs.lint] template = "lint" # don't inherit from default! dependencies = [ - "mypy==1.10.0", - "ruff==0.4.4", + "mypy==1.11.1", + "ruff==0.5.7", ] [tool.hatch.envs.lint.scripts] typing = [