Skip to content

Commit

Permalink
chore: Template upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Oct 20, 2024
1 parent 100d391 commit 459f7d7
Show file tree
Hide file tree
Showing 15 changed files with 132 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 1.4.0
_commit: 1.5.2
_src_path: gh:pawamoy/copier-uv
author_email: dev@pawamoy.fr
author_fullname: Timothée Mazzucotelli
Expand Down
34 changes: 22 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,20 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Fetch all tags
run: git fetch --depth=1 --tags

- name: Set up Python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Install uv
run: pip install uv
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: pyproject.toml

- name: Install dependencies
run: make setup
Expand All @@ -61,12 +64,12 @@ jobs:
- macos-latest
- windows-latest
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
resolution:
- highest
- lowest-direct
Expand All @@ -76,20 +79,27 @@ jobs:
- os: windows-latest
resolution: lowest-direct
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.python-version == '3.13' }}
continue-on-error: ${{ matrix.python-version == '3.14' }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Set up Python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install uv
run: pip install uv
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: py${{ matrix.python-version }}

- name: Install dependencies
env:
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch all tags
run: git fetch --depth=1 --tags
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Python
uses: actions/setup-python@v4
- name: Install git-changelog
run: pip install git-changelog
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup uv
uses: astral-sh/setup-uv@v3
- name: Prepare release notes
run: git-changelog --release-notes > release-notes.md
run: uv tool run git-changelog --release-notes > release-notes.md
- name: Create release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
body_path: release-notes.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/.pdm-build/
/htmlcov/
/site/
uv.lock

# cache
.cache/
Expand Down
6 changes: 0 additions & 6 deletions .gitpod.dockerfile

This file was deleted.

13 changes: 0 additions & 13 deletions .gitpod.yml

This file was deleted.

5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ make setup
> You can install it with:
>
> ```bash
> python3 -m pip install --user pipx
> pipx install uv
> curl -LsSf https://astral.sh/uv/install.sh | sh
> ```
>
> Now you can try running `make setup` again,
> or simply `uv install`.
> or simply `uv sync`.
You now have the dependencies installed.
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,16 @@
[![ci](https://github.com/mkdocstrings/griffe-inherited-docstrings/workflows/ci/badge.svg)](https://github.com/mkdocstrings/griffe-inherited-docstrings/actions?query=workflow%3Aci)
[![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://mkdocstrings.github.io/griffe-inherited-docstrings/)
[![pypi version](https://img.shields.io/pypi/v/griffe-inherited-docstrings.svg)](https://pypi.org/project/griffe-inherited-docstrings/)
[![gitpod](https://img.shields.io/badge/gitpod-workspace-708FCC.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/griffe-inherited-docstrings)
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#griffe-inherited-docstrings:gitter.im)

Griffe extension for inheriting docstrings.

## Installation

With `pip`:

```bash
pip install griffe-inherited-docstrings
```

With [`pipx`](https://github.com/pipxproject/pipx):

```bash
python3.8 -m pip install --user pipx
pipx install griffe-inherited-docstrings
```

## Usage

With Python:
Expand Down
2 changes: 1 addition & 1 deletion config/ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
target-version = "py38"
target-version = "py39"
line-length = 120

[lint]
Expand Down
32 changes: 0 additions & 32 deletions devdeps.txt

This file was deleted.

8 changes: 5 additions & 3 deletions duties.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
from contextlib import contextmanager
from importlib.metadata import version as pkgversion
from pathlib import Path
from typing import TYPE_CHECKING, Iterator
from typing import TYPE_CHECKING

from duty import duty, tools

if TYPE_CHECKING:
from collections.abc import Iterator

from duty.context import Context


Expand Down Expand Up @@ -53,8 +55,8 @@ def changelog(ctx: Context, bump: str = "") -> None:
ctx.run(tools.git_changelog(bump=bump or None), title="Updating changelog")


@duty(pre=["check_quality", "check_types", "check_docs", "check_dependencies", "check-api"])
def check(ctx: Context) -> None: # noqa: ARG001
@duty(pre=["check-quality", "check-types", "check-docs", "check-api"])
def check(ctx: Context) -> None:
"""Check it all!"""


Expand Down
6 changes: 4 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,15 @@ plugins:
show_root_heading: true
show_root_full_path: false
show_signature_annotations: true
show_source: true
show_symbol_type_heading: true
show_symbol_type_toc: true
signature_crossrefs: true
summary: true
- git-committers:
- git-revision-date-localized:
enabled: !ENV [DEPLOY, false]
repository: mkdocstrings/griffe-inherited-docstrings
enable_creation_date: true
type: timeago
- minify:
minify_html: !ENV [DEPLOY, false]
- group:
Expand Down
39 changes: 38 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Documentation",
"Topic :: Software Development",
"Topic :: Utilities",
Expand Down Expand Up @@ -55,7 +56,6 @@ source-includes = [
"scripts",
"share",
"tests",
"devdeps.txt",
"duties.py",
"mkdocs.yml",
"*.md",
Expand All @@ -66,3 +66,40 @@ source-includes = [
data = [
{path = "share/**/*", relative-to = "."},
]

[tool.uv]
dev-dependencies = [
# dev
"editables>=0.5",

# maintenance
"build>=1.2",
"git-changelog>=2.5",
"twine>=5.1",

# ci
"duty>=1.4",
"ruff>=0.4",
"pytest>=8.2",
"pytest-cov>=5.0",
"pytest-randomly>=3.15",
"pytest-xdist>=3.6",
"mypy>=1.10",
"types-markdown>=3.6",
"types-pyyaml>=6.0",

# docs
"black>=24.4",
"markdown-callouts>=0.4",
"markdown-exec>=1.8",
"mkdocs>=1.6",
"mkdocs-coverage>=1.0",
"mkdocs-gen-files>=0.5",
"mkdocs-git-revision-date-localized-plugin>=1.2",
"mkdocs-literate-nav>=0.6",
"mkdocs-material>=9.5",
"mkdocs-minify-plugin>=0.8",
"mkdocstrings[python]>=0.25",
# YORE: EOL 3.10: Remove line.
"tomli>=2.0; python_version < '3.11'",
]
12 changes: 6 additions & 6 deletions scripts/gen_credits.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
import os
import sys
from collections import defaultdict
from collections.abc import Iterable
from importlib.metadata import distributions
from itertools import chain
from pathlib import Path
from textwrap import dedent
from typing import Dict, Iterable, Union
from typing import Union

from jinja2 import StrictUndefined
from jinja2.sandbox import SandboxedEnvironment
from packaging.requirements import Requirement

# TODO: Remove once support for Python 3.10 is dropped.
# YORE: EOL 3.10: Replace block with line 2.
if sys.version_info >= (3, 11):
import tomllib
else:
Expand All @@ -26,11 +27,10 @@
pyproject = tomllib.load(pyproject_file)
project = pyproject["project"]
project_name = project["name"]
with project_dir.joinpath("devdeps.txt").open() as devdeps_file:
devdeps = [line.strip() for line in devdeps_file if line.strip() and not line.strip().startswith(("-e", "#"))]
devdeps = [dep for dep in pyproject["tool"]["uv"]["dev-dependencies"] if not dep.startswith("-e")]

PackageMetadata = Dict[str, Union[str, Iterable[str]]]
Metadata = Dict[str, PackageMetadata]
PackageMetadata = dict[str, Union[str, Iterable[str]]]
Metadata = dict[str, PackageMetadata]


def _merge_fields(metadata: dict) -> PackageMetadata:
Expand Down
Loading

0 comments on commit 459f7d7

Please sign in to comment.