Skip to content

Commit 3c9930e

Browse files
committed
chore: Upgrade with copier-poetry template
1 parent 1bff837 commit 3c9930e

26 files changed

Lines changed: 436 additions & 366 deletions

.copier-answers.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Changes here will be overwritten by Copier
2+
_commit: 7ceb049
3+
_src_path: gh:pawamoy/copier-poetry
4+
author_email: pawamoy@pm.me
5+
author_fullname: "Timoth\xE9e Mazzucotelli"
6+
author_username: pawamoy
7+
copyright_date: '2020'
8+
copyright_holder: "Timoth\xE9e Mazzucotelli"
9+
copyright_holder_email: pawamoy@pm.me
10+
copyright_license: ISC License
11+
project_description: Automatic documentation from sources, for MkDocs.
12+
project_name: mkdocstrings
13+
python_package_command_line_name: mkdocstrings
14+
python_package_distribution_name: mkdocstrings
15+
python_package_import_name: mkdocstrings
16+
repository_name: mkdocstrings
17+
repository_namespace: pawamoy
18+
repository_provider: github.com

.cruft.json

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

.flake8

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

.github/workflows/ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
jobs:
16+
17+
quality:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Set up Python 3.6
26+
uses: actions/setup-python@v1
27+
with:
28+
python-version: 3.6
29+
30+
- name: Set up the cache
31+
uses: actions/cache@v1
32+
with:
33+
path: .venv
34+
key: cache-python-packages
35+
36+
- name: Set up the project
37+
run: |
38+
pip install poetry safety
39+
poetry config virtualenvs.in-project true
40+
make setup
41+
42+
- name: Check if the documentation builds correctly
43+
run: make check-docs
44+
45+
- name: Check the code quality
46+
run: make check-code-quality
47+
48+
- name: Check if the code is correctly typed
49+
run: make check-types
50+
51+
- name: Check for vulnerabilities in dependencies
52+
run: make check-dependencies
53+
54+
tests:
55+
56+
strategy:
57+
max-parallel: 6
58+
matrix:
59+
os: [ubuntu-latest]
60+
python-version: [3.6,3.7,3.8]
61+
62+
runs-on: ${{ matrix.os }}
63+
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v2
67+
68+
- name: Set up Python ${{ matrix.python-version }}
69+
uses: actions/setup-python@v1
70+
with:
71+
python-version: ${{ matrix.python-version }}
72+
73+
- name: Set up the cache
74+
uses: actions/cache@v1
75+
env:
76+
cache-name: cache-python-packages
77+
with:
78+
path: .venv
79+
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ env.cache-name }}
80+
restore-keys: |
81+
${{ matrix.os }}-${{ matrix.python-version }}-
82+
${{ matrix.os }}-
83+
84+
- name: Set up the project
85+
run: |
86+
pip install poetry
87+
poetry config virtualenvs.in-project true
88+
make setup
89+
90+
- name: Run the test suite
91+
run: make test

.gitlab-ci.yml

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

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
<!-- insertion marker -->
78
## [v0.11.0](https://github.com/pawamoy/mkdocstrings/releases/tag/v0.11.0) - 2020-04-23
89

910
<small>[Compare with v0.10.3](https://github.com/pawamoy/mkdocstrings/compare/v0.10.3...v0.11.0)</small>

CONTRIBUTING.md

Lines changed: 53 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,55 @@
11
# Contributing
22

33
Contributions are welcome, and they are greatly appreciated!
4-
54
Every little bit helps, and credit will always be given.
65

7-
For bug reports, feature requests, and feedback,
8-
simply create a new [issue][1].
9-
Try to be as descriptive as possible.
6+
## Environment setup
107

11-
## Setup
8+
Nothing easier!
129

13-
This project is developed using [`poetry`](https://github.com/sdispater/poetry).
14-
Follow the recommended installation method:
10+
Fork and clone the repository, then:
1511

1612
```bash
17-
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
13+
cd mkdocstrings
14+
make setup
1815
```
1916

20-
...or install it with [`pipx`](https://github.com/pipxproject/pipx):
21-
22-
```
23-
pipx install poetry
24-
```
17+
That's it!
2518

26-
Then follow these instructions:
19+
You now have the dependencies installed.
2720

28-
1. Fork the repository [on github.com][2];
29-
1. Clone it on your machine;
30-
1. Go into the directory, and run `poetry install` to install all the dependencies into a new virtualenv.
21+
Run `make help` to see all the available actions!
3122

32-
## New feature or bug fix
23+
## Development
3324

34-
1. Create a new branch with `git checkout -b bug-fix-or-feature-name`;
35-
1. Code!
36-
1. **Format the code with `make lint`.**
37-
1. **Run the quality checks with `make check`.**
38-
1. **Write tests. Run them all with `make test`.**
25+
As usual:
3926

40-
## Running tests
27+
1. create a new branch: `git checkout -b feature-or-bugfix-name`
28+
1. edit the code and/or the documentation
4129

42-
The command to run the tests is:
43-
44-
```
45-
make test
46-
```
30+
If you updated the documentation or the project dependencies:
4731

48-
*Type `make` to see all the available rules.*
32+
1. run `make docs-regen`
33+
1. run `make docs-serve`,
34+
go to http://localhost:8000 and check that everything looks good
4935

50-
For more flexibility:
36+
**Before committing:**
5137

52-
```bash
53-
poetry run pytest # to run all tests sequentially
54-
poetry run pytest -v # to print one test per line
55-
poetry run pytest -n 4 # to run tests in parallel (4 workers)
56-
poetry run pytest tests/test_api.py # to run tests in a specific file
57-
```
58-
59-
`pytest` provides the `-k` option to select tests based on their names:
60-
61-
```bash
62-
poetry run pytest -k "api and remove"
63-
poetry run pytest -k "utils or stats"
64-
```
38+
1. run `make format` to auto-format the code
39+
1. run `make check` to check everything (fix any warning)
40+
1. run `make test` to run the tests (fix any issue)
41+
1. follow our [commit message convention](#commit-message-convention)
6542

66-
See the [documentation for the `-k` option][3] for more examples.
43+
If you are unsure about how to fix or ignore a warning,
44+
just let the continuous integration fail,
45+
and we will help you during review.
6746

68-
## Commits messages
47+
Don't bother updating the changelog, we will take care of this.
6948

70-
Make sure to have atomic commits and contextual commit messages!
71-
[Check out this blog post by Chris Beams for more information][4].
49+
## Commit message convention
7250

73-
Commits messages must follow the [Angular style](https://gist.github.com/stephenparish/9941e89d80e2bc58a153#format-of-the-commit-message):
51+
Commits messages must follow the
52+
[Angular style](https://gist.github.com/stephenparish/9941e89d80e2bc58a153#format-of-the-commit-message):
7453

7554
```
7655
<type>[(scope)]: Subject
@@ -88,11 +67,11 @@ Scope and body are optional. Type can be:
8867
- `fix`: Bug fix.
8968
- `perf`: About performance.
9069
- `refactor`: Changes which are not features nor bug fixes.
91-
- `revert`: When reverting a commit.
9270
- `style`: A change in code style/format.
9371
- `tests`: About tests.
9472

95-
Subject (and body) must be valid Markdown. If you write a body, please add issues references at the end:
73+
**Subject (and body) must be valid Markdown.**
74+
If you write a body, please add issues references at the end:
9675

9776
```
9877
Body.
@@ -101,13 +80,28 @@ References: #10, #11.
10180
Fixes #15.
10281
```
10382

104-
## Pull Requests
83+
## Pull requests guidelines
10584

106-
Push your code, and finally create a new [pull request][5].
107-
Make sure to follow the guidelines.
85+
Link to any related issue in the Pull Request message.
86+
87+
During review, we recommend using fixups:
88+
89+
```bash
90+
# SHA is the SHA of the commit you want to fix
91+
git commit --fixup=SHA
92+
```
93+
94+
Once all the changes are approved, you can squash your commits:
95+
96+
```bash
97+
git rebase -i --autosquash master
98+
```
99+
100+
And force-push:
101+
102+
```bash
103+
git push -f
104+
```
108105

109-
[1]: https://github.com/pawamoy/mkdocstrings/issues/new
110-
[2]: https://github.com/pawamoy/mkdocstrings
111-
[3]: https://docs.pytest.org/en/latest/example/markers.html#using-k-expr-to-select-tests-based-on-their-name
112-
[4]: http://chris.beams.io/posts/git-commit/
113-
[5]: https://github.com/pawamoy/mkdocstrings/compare
106+
If this seems all too complicated, you can push or force-push each new commit,
107+
and we will squash them ourselves if needed, before merging.

0 commit comments

Comments
 (0)