Skip to content

Commit 85f3920

Browse files
authored
chore: Switch to PDM template
PR #13: #13
1 parent 5b2c447 commit 85f3920

28 files changed

Lines changed: 627 additions & 273 deletions

.copier-answers.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changes here will be overwritten by Copier
2+
_commit: 0.9.0
3+
_src_path: gh:pawamoy/copier-pdm.git
4+
author_email: pawamoy@pm.me
5+
author_fullname: Timothée Mazzucotelli
6+
author_username: pawamoy
7+
copyright_date: '2019'
8+
copyright_holder: Timothée Mazzucotelli
9+
copyright_holder_email: pawamoy@pm.me
10+
copyright_license: ISC License
11+
project_description: Automatically link across pages in MkDocs.
12+
project_name: mkdocs-autorefs
13+
python_package_command_line_name: mkdocs-autorefs
14+
python_package_distribution_name: mkdocs-autorefs
15+
python_package_import_name: mkdocs_autorefs
16+
repository_name: autorefs
17+
repository_namespace: mkdocstrings
18+
repository_provider: github.com
19+
use_precommit: false
20+

.github/FUNDING.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 54 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ defaults:
1111
shell: bash
1212

1313
env:
14-
LANG: "en_US.utf-8"
15-
LC_ALL: "en_US.utf-8"
16-
POETRY_VIRTUALENVS_IN_PROJECT: "true"
17-
PYTHONIOENCODING: "UTF-8"
18-
PYTHONPATH: docs
14+
LANG: en_US.utf-8
15+
LC_ALL: en_US.utf-8
16+
PYTHONIOENCODING: UTF-8
1917

2018
jobs:
2119

@@ -27,66 +25,85 @@ jobs:
2725
- name: Checkout
2826
uses: actions/checkout@v2
2927

30-
- name: Set up Python
31-
uses: actions/setup-python@v2
28+
- name: Set up PDM
29+
uses: pdm-project/setup-pdm@v2.5
3230
with:
33-
python-version: 3.8
31+
python-version: "3.8"
3432

35-
- name: Set up the cache
36-
uses: actions/cache@v1
33+
- name: Set cache variables
34+
id: set_variables
35+
run: |
36+
echo "::set-output name=PIP_CACHE::$(pip cache dir)"
37+
echo "::set-output name=PDM_CACHE::$(pdm config cache_dir)"
38+
39+
- name: Set up cache
40+
uses: actions/cache@v2
3741
with:
38-
path: .venv
39-
key: quality-venv-cache-2
42+
path: |
43+
${{ steps.set_variables.outputs.PIP_CACHE }}
44+
${{ steps.set_variables.outputs.PDM_CACHE }}
45+
key: checks-cache
4046

41-
- name: Set up the project
42-
run: |
43-
pip install poetry
44-
poetry install -v || { rm -rf .venv; poetry install -v; }
45-
poetry update
47+
- name: Resolving dependencies
48+
run: pdm lock
49+
50+
- name: Install dependencies
51+
run: pdm install -G duty -G docs -G quality -G typing -G security
4652

4753
- name: Check if the documentation builds correctly
48-
run: poetry run duty check-docs
54+
run: pdm run duty check-docs
4955

5056
- name: Check the code quality
51-
run: poetry run duty check-code-quality
57+
run: pdm run duty check-quality
5258

5359
- name: Check if the code is correctly typed
54-
run: poetry run duty check-types
60+
run: pdm run duty check-types
5561

5662
- name: Check for vulnerabilities in dependencies
57-
run: |
58-
pip install safety
59-
poetry run duty check-dependencies
63+
run: pdm run duty check-dependencies
6064

6165
tests:
6266

6367
strategy:
6468
matrix:
65-
os: [ubuntu-latest, macos-latest, windows-latest]
66-
python-version: [3.6, 3.7, 3.8, 3.9]
69+
os:
70+
- ubuntu-latest
71+
- macos-latest
72+
- windows-latest
73+
python-version:
74+
- "3.7"
75+
- "3.8"
76+
- "3.9"
77+
- "3.10"
78+
- "3.11-dev"
6779

6880
runs-on: ${{ matrix.os }}
6981

7082
steps:
7183
- name: Checkout
7284
uses: actions/checkout@v2
7385

74-
- name: Set up Python ${{ matrix.python-version }}
75-
uses: actions/setup-python@v2
86+
- name: Set up PDM
87+
uses: pdm-project/setup-pdm@v2.5
7688
with:
7789
python-version: ${{ matrix.python-version }}
7890

79-
- name: Set up the cache
80-
uses: actions/cache@v1
91+
- name: Set cache variables
92+
id: set_variables
93+
run: |
94+
echo "::set-output name=PIP_CACHE::$(pip cache dir)"
95+
echo "::set-output name=PDM_CACHE::$(pdm config cache_dir)"
96+
97+
- name: Set up cache
98+
uses: actions/cache@v2
8199
with:
82-
path: .venv
83-
key: tests-venv-cache-${{ matrix.os }}-py${{ matrix.python-version }}
100+
path: |
101+
${{ steps.set_variables.outputs.PIP_CACHE }}
102+
${{ steps.set_variables.outputs.PDM_CACHE }}
103+
key: tests-cache-${{ runner.os }}-${{ matrix.python-version }}
84104

85-
- name: Set up the project
86-
run: |
87-
pip install poetry
88-
poetry install -v || { rm -rf .venv; poetry install -v; }
89-
poetry update
105+
- name: Install dependencies
106+
run: pdm install -G duty -G tests
90107

91108
- name: Run the test suite
92-
run: poetry run duty test
109+
run: pdm run duty test

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ __pycache__/
44
dist/
55
*.egg-info/
66
build/
7+
htmlcov/
78
.coverage*
89
pip-wheel-metadata/
910
.pytest_cache/
1011
.python-version
1112
site/
12-
poetry.lock
13-
.mypy_cache/
13+
pdm.lock
14+
.pdm.toml
15+
__pypackages__/
1416
.venv/

.gitpod.dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM gitpod/workspace-full
2+
USER gitpod
3+
ENV PIP_USER=no
4+
ENV PYTHON_VERSIONS=
5+
RUN pip3 install pipx; \
6+
pipx install pdm; \
7+
pipx ensurepath

.gitpod.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
vscode:
2+
extensions:
3+
- ms-python.python
4+
5+
image:
6+
file: .gitpod.dockerfile
7+
8+
ports:
9+
- port: 8000
10+
onOpen: notify
11+
12+
tasks:
13+
- init: make setup

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3636
### Features
3737
- Allow registering absolute URLs for autorefs ([621686b](https://github.com/mkdocstrings/autorefs/commit/621686b4b36b8d24df80035095700f6a4f96567c) by Oleh Prypin). [PR #8](https://github.com/mkdocstrings/autorefs/pull/8)
3838
- Allow external tools to insert references that are OK to skip ([7619c28](https://github.com/mkdocstrings/autorefs/commit/7619c2835a63b54b1f5e9e11c5f320c04e3579ac) by Oleh Prypin). [PR #7](https://github.com/mkdocstrings/autorefs/pull/7)
39-
- Allow [`identifier`][], understood as [`identifier`][identifier] ([2d3182d](https://github.com/mkdocstrings/autorefs/commit/2d3182db54dc33e75914e9c509bbf849842eb70a) by Oleh Prypin). [PR #5](https://github.com/mkdocstrings/autorefs/pull/5)
39+
- Allow `[``identifier``][]`, understood as `[``identifier``][identifier]` ([2d3182d](https://github.com/mkdocstrings/autorefs/commit/2d3182db54dc33e75914e9c509bbf849842eb70a) by Oleh Prypin). [PR #5](https://github.com/mkdocstrings/autorefs/pull/5)
4040

4141

4242
## [0.1.1](https://github.com/mkdocstrings/autorefs/releases/tag/0.1.1) - 2021-02-28

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,23 @@ make setup
1717
!!! note
1818
If it fails for some reason,
1919
you'll need to install
20-
[Poetry](https://github.com/python-poetry/poetry)
20+
[PDM](https://github.com/pdm-project/pdm)
2121
manually.
2222

2323
You can install it with:
2424

2525
```bash
2626
python3 -m pip install --user pipx
27-
pipx install poetry
27+
pipx install pdm
2828
```
2929

3030
Now you can try running `make setup` again,
31-
or simply `poetry install`.
31+
or simply `pdm install`.
3232

3333
You now have the dependencies installed.
3434

35+
You can run the application with `pdm run mkdocs-autorefs [ARGS...]`.
36+
3537
Run `make help` to see all the available actions!
3638

3739
## Tasks
@@ -43,11 +45,9 @@ on multiple Python versions, you can do one of the following:
4345

4446
1. `export PYTHON_VERSIONS= `: this will run the task
4547
with only the current Python version
46-
2. run the task directly with `poetry run duty TASK`,
47-
or `duty TASK` if the environment was already activated
48-
through `poetry shell`
48+
2. run the task directly with `pdm run duty TASK`
4949

50-
The Makefile detects if the Poetry environment is activated,
50+
The Makefile detects if a virtual environment is activated,
5151
so `make` will work the same with the virtualenv activated or not.
5252

5353
## Development

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
.DEFAULT_GOAL := help
22
SHELL := bash
33

4-
DUTY = $(shell [ -n "${VIRTUAL_ENV}" ] || echo poetry run) duty
4+
DUTY = $(shell [ -n "${VIRTUAL_ENV}" ] || echo pdm run) duty
55

66
args = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
7-
check_code_quality_args = files
7+
check_quality_args = files
88
docs_serve_args = host port
99
release_args = version
1010
test_args = cleancov match
1111

1212
BASIC_DUTIES = \
1313
changelog \
14+
check-dependencies \
1415
clean \
1516
coverage \
1617
docs \
@@ -21,9 +22,7 @@ BASIC_DUTIES = \
2122
release
2223

2324
QUALITY_DUTIES = \
24-
check \
25-
check-code-quality \
26-
check-dependencies \
25+
check-quality \
2726
check-docs \
2827
check-types \
2928
test
@@ -32,10 +31,19 @@ QUALITY_DUTIES = \
3231
help:
3332
@$(DUTY) --list
3433

34+
.PHONY: lock
35+
lock:
36+
@pdm lock
37+
3538
.PHONY: setup
3639
setup:
3740
@bash scripts/setup.sh
3841

42+
.PHONY: check
43+
check:
44+
@bash scripts/multirun.sh duty check-quality check-types check-docs
45+
@$(DUTY) check-dependencies
46+
3947
.PHONY: $(BASIC_DUTIES)
4048
$(BASIC_DUTIES):
4149
@$(DUTY) $@ $(call args,$@)

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# mkdocs-autorefs
22

33
[![ci](https://github.com/mkdocstrings/autorefs/workflows/ci/badge.svg)](https://github.com/mkdocstrings/autorefs/actions?query=workflow%3Aci)
4-
[![pypi version](https://img.shields.io/pypi/v/mkdocs-autorefs.svg)](https://pypi.org/project/mkdocs-autorefs/)
5-
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://gitter.im/mkdocstrings/community)
4+
[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://mkdocstrings.github.io/autorefs/)
5+
[![pypi version](https://img.shields.io/pypi/v/autorefs.svg)](https://pypi.org/project/autorefs/)
6+
[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/autorefs)
7+
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://gitter.im/autorefs/community)
68

79
Automatically link across pages in MkDocs.
810

@@ -49,10 +51,10 @@ Note that this plugin's behavior is undefined when trying to link to a heading t
4951

5052
## Requirements
5153

52-
`mkdocs-autorefs` requires Python 3.6 or above.
54+
mkdocs-autorefs requires Python 3.7 or above.
5355

5456
<details>
55-
<summary>To install Python 3.6, I recommend using <a href="https://github.com/pyenv/pyenv"><code>pyenv</code></a>.</summary>
57+
<summary>To install Python 3.7, I recommend using <a href="https://github.com/pyenv/pyenv"><code>pyenv</code></a>.</summary>
5658

5759
```bash
5860
# install pyenv
@@ -63,10 +65,10 @@ export PATH="${HOME}/.pyenv/bin:${PATH}"
6365
export PYENV_ROOT="${HOME}/.pyenv"
6466
eval "$(pyenv init -)"
6567
66-
# install Python 3.6
67-
pyenv install 3.6.12
68+
# install Python 3.7
69+
pyenv install 3.7.12
6870
6971
# make it available globally
70-
pyenv global system 3.6.12
72+
pyenv global system 3.7.12
7173
```
7274
</details>

0 commit comments

Comments
 (0)