Skip to content

Commit

Permalink
chore: Template upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jun 7, 2024
1 parent 58b1742 commit e438336
Show file tree
Hide file tree
Showing 9 changed files with 256 additions and 452 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.2.4
_commit: 1.2.8
_src_path: gh:pawamoy/copier-uv
author_email: dev@pawamoy.fr
author_fullname: Timothée Mazzucotelli
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ jobs:
- name: Check if the code is correctly typed
run: make check-types

- name: Check for vulnerabilities in dependencies
run: make check-dependencies

- name: Check for breaking changes in the API
run: make check-api

Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ actions = \
changelog \
check \
check-api \
check-dependencies \
check-docs \
check-quality \
check-types \
Expand All @@ -26,4 +25,4 @@ actions = \

.PHONY: $(actions)
$(actions):
@bash scripts/make "$@"
@python scripts/make "$@"
2 changes: 0 additions & 2 deletions config/pytest.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[pytest]
python_files =
test_*.py
*_test.py
tests.py
addopts =
--cov
--cov-config config/coverage.ini
Expand Down
6 changes: 0 additions & 6 deletions config/vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
"command": "scripts/make",
"args": ["check-docs"]
},
{
"label": "check-dependencies",
"type": "process",
"command": "scripts/make",
"args": ["check-dependencies"]
},
{
"label": "check-api",
"type": "process",
Expand Down
37 changes: 18 additions & 19 deletions devdeps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,36 @@
editables>=0.5

# maintenance
build>=1.0
git-changelog>=2.3
twine>=5.0
build>=1.2
git-changelog>=2.5
twine>=5.1; python_version < '3.13'

# ci
duty>=0.10
ruff>=0.0
duty>=1.4
ruff>=0.4
jsonschema>=4.17
pysource-codegen>=0.4
pysource-minimize>=0.5
pytest>=7.4
pytest-cov>=4.1
pytest>=8.2
pytest-cov>=5.0
pytest-randomly>=3.15
pytest-xdist>=3.3
mypy>=1.5
types-markdown>=3.5
pytest-xdist>=3.6
mypy>=1.10
types-markdown>=3.6
types-pyyaml>=6.0
safety>=2.3

# docs
black>=23.9
black>=24.4
griffe-inherited-docstrings>=1.0
markdown-callouts>=0.3
markdown-exec>=1.7
mkdocs>=1.5
markdown-callouts>=0.4
markdown-exec>=1.8
mkdocs>=1.6
mkdocs-coverage>=1.0
mkdocs-gen-files>=0.5
mkdocs-git-committers-plugin-2>=1.2
mkdocs-git-committers-plugin-2>=2.3
mkdocs-literate-nav>=0.6
mkdocs-material>=9.4
mkdocs-minify-plugin>=0.7
mkdocstrings[python]>=0.23
mkdocs-material>=9.5
mkdocs-minify-plugin>=0.8
mkdocstrings[python]>=0.25
rich>=12.6
tomli>=2.0; python_version < '3.11'
124 changes: 6 additions & 118 deletions docs/insiders/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ of Insiders projects in the PyPI index of your choice
See [how to install it](https://pawamoy.github.io/pypi-insiders/#installation)
and [how to use it](https://pawamoy.github.io/pypi-insiders/#usage).

**We kindly ask that you do not upload the distributions to public registries,
as it is against our [Terms of use](index.md#terms).**

### with pip (ssh/https)

*Griffe Insiders* can be installed with `pip` [using SSH][using ssh]:
Expand Down Expand Up @@ -58,130 +61,15 @@ pip install git+https://${GH_TOKEN}@github.com/pawamoy-insiders/griffe.git
> token must be kept secret at all times, as it allows the owner to access your
> private repositories.
### with pip (self-hosted)

Self-hosting the Insiders package makes it possible to depend on *Griffe* normally,
while transparently downloading and installing the Insiders version locally.
It means that you can specify your dependencies normally, and your contributors without access
to Insiders will get the public version, while you get the Insiders version on your machine.

WARNING: **Limitation**
With this method, there is no way to force the installation of an Insiders version
rather than a public version. If there is a public version that is more recent
than your self-hosted Insiders version, the public version will take precedence.
Remember to regularly update your self-hosted versions by uploading latest distributions.

You can build the distributions for Insiders yourself, by cloning the repository
and using [build] to build the distributions,
or you can download them from our [GitHub Releases].
You can upload these distributions to a private PyPI-like registry
([Artifactory], [Google Cloud], [pypiserver], etc.)
with [Twine]:

[build]: https://pypi.org/project/build/
[Artifactory]: https://jfrog.com/help/r/jfrog-artifactory-documentation/pypi-repositories
[Google Cloud]: https://cloud.google.com/artifact-registry/docs/python
[pypiserver]: https://pypi.org/project/pypiserver/
[Github Releases]: https://github.com/pawamoy-insiders/griffe/releases
[Twine]: https://pypi.org/project/twine/

```bash
# download distributions in ~/dists, then upload with:
twine upload --repository-url https://your-private-index.com ~/dists/*
```

<small>You might also need to provide a username and password/token to authenticate against the registry.
Please check [Twine's documentation][twine docs].</small>

[twine docs]: https://twine.readthedocs.io/en/stable/

You can then configure pip (or other tools) to look for packages into your package index.
For example, with pip:

```bash
pip config set global.extra-index-url https://your-private-index.com/simple
```

Note that the URL might differ depending on whether your are uploading a package (with Twine)
or installing a package (with pip), and depending on the registry you are using (Artifactory, Google Cloud, etc.).
Please check the documentation of your registry to learn how to configure your environment.

**We kindly ask that you do not upload the distributions to public registries,
as it is against our [Terms of use](index.md#terms).**
### with Git

>? TIP: **Full example with `pypiserver`**
> In this example we use [pypiserver] to serve a local PyPI index.
>
> ```bash
> pip install --user pypiserver
> # or pipx install pypiserver
>
> # create a packages directory
> mkdir -p ~/.local/pypiserver/packages
>
> # run the pypi server without authentication
> pypi-server run -p 8080 -a . -P . ~/.local/pypiserver/packages &
> ```
>
> We can configure the credentials to access the server in [`~/.pypirc`][pypirc]:
>
> [pypirc]: https://packaging.python.org/en/latest/specifications/pypirc/
>
> ```ini title=".pypirc"
> [distutils]
> index-servers =
> local
>
> [local]
> repository: http://localhost:8080
> username:
> password:
> ```
>
> We then clone the Insiders repository, build distributions and upload them to our local server:
>
> ```bash
> # clone the repository
> git clone git@github.com:pawamoy-insiders/griffe
> cd griffe
>
> # install build
> pip install --user build
> # or pipx install build
>
> # checkout latest tag
> git checkout $(git describe --tags --abbrev=0)
>
> # build the distributions
> pyproject-build
>
> # upload them to our local server
> twine upload -r local dist/* --skip-existing
> ```
>
> Finally, we configure pip, and for example [PDM][pdm], to use our local index to find packages:
>
> ```bash
> pip config set global.extra-index-url http://localhost:8080/simple
> pdm config pypi.extra.url http://localhost:8080/simple
> ```
>
> [pdm]: https://pdm.fming.dev/latest/
>
> Now when running `pip install griffe`,
> or resolving dependencies with PDM,
> both tools will look into our local index and find the Insiders version.
> **Remember to update your local index regularly!**
### with git
Of course, you can use *Griffe Insiders* directly from `git`:
Of course, you can use *Griffe Insiders* directly using Git:

```
git clone git@github.com:pawamoy-insiders/griffe
```

When cloning from `git`, the package must be installed:
When cloning with Git, the package must be installed:

```
pip install -e griffe
Expand Down
Loading

0 comments on commit e438336

Please sign in to comment.