Skip to content

Commit 6c63bfc

Browse files
author
Guen Prawiroatmodjo
committed
use cookie
1 parent fdcd0b7 commit 6c63bfc

30 files changed

Lines changed: 892 additions & 180 deletions

.git_archival.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git_archival.txt export-subst

.github/CODE_OF_CONDUCT.md

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

.github/CONTRIBUTING.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
See the [Scientific Python Developer Guide][spc-dev-intro] for a detailed
2+
description of best practices for developing scientific packages.
3+
4+
[spc-dev-intro]: https://learn.scientific-python.org/development/
5+
6+
# Quick development
7+
8+
The fastest way to start with development is to use nox. If you don't have nox,
9+
you can use `uvx nox` to run it without installing, or `uv tool install nox`. If
10+
you don't have uv, you can
11+
[install it a variety of ways](https://docs.astral.sh/uv/getting-started/installation/),
12+
including with pip, pipx, brew, and just downloading the binary (single file).
13+
14+
To use, run `nox`. This will lint and test using every installed version of
15+
Python on your system, skipping ones that are not installed. You can also run
16+
specific jobs:
17+
18+
```console
19+
$ nox -s lint # Lint only
20+
$ nox -s tests # Python tests
21+
$ nox -s docs # Build and serve the docs
22+
$ nox -s build # Make an SDist and wheel
23+
```
24+
25+
Nox handles everything for you, including setting up an temporary virtual
26+
environment for each run.
27+
28+
# Setting up a development environment manually
29+
30+
You can set up a development environment by running:
31+
32+
```bash
33+
uv sync
34+
```
35+
36+
# Pre-commit
37+
38+
You should prepare pre-commit, which will help you by checking that commits pass
39+
required checks:
40+
41+
```bash
42+
uv tool install pre-commit # or brew install pre-commit on macOS
43+
pre-commit install # Will install a pre-commit hook into the git repo
44+
```
45+
46+
You can also/alternatively run `pre-commit run` (changes only) or
47+
`pre-commit run --all-files` to check even without installing the hook.
48+
49+
# Testing
50+
51+
Use pytest to run the unit checks:
52+
53+
```bash
54+
uv run pytest
55+
```
56+
57+
# Coverage
58+
59+
Use pytest-cov to generate coverage reports:
60+
61+
```bash
62+
uv run pytest --cov=api-tracer
63+
```
64+
65+
# Building docs
66+
67+
You can build and serve the docs using:
68+
69+
```bash
70+
nox -s docs
71+
```
72+
73+
You can build the docs only with:
74+
75+
```bash
76+
nox -s docs --non-interactive
77+
```

.github/ISSUE_TEMPLATE.md

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

.github/PULL_REQUEST_TEMPLATE.md

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

.github/dependabot.yaml

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

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
groups:
9+
actions:
10+
patterns:
11+
- "*"

.github/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- dependabot
5+
- pre-commit-ci

.github/workflows/cd.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CD
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
release:
10+
types:
11+
- published
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
# Many color libraries just need this to be set to any value, but at least
19+
# one distinguishes color depth, where "3" -> "256-bit color".
20+
FORCE_COLOR: 3
21+
22+
jobs:
23+
dist:
24+
name: Distribution build
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- uses: hynek/build-and-inspect-python-package@v2
33+
34+
publish:
35+
needs: [dist]
36+
name: Publish to PyPI
37+
environment: pypi
38+
permissions:
39+
id-token: write
40+
attestations: write
41+
contents: read
42+
runs-on: ubuntu-latest
43+
if: github.event_name == 'release' && github.event.action == 'published'
44+
45+
steps:
46+
- uses: actions/download-artifact@v4
47+
with:
48+
name: Packages
49+
path: dist
50+
51+
- name: Generate artifact attestation for sdist and wheel
52+
uses: actions/attest-build-provenance@v2
53+
with:
54+
subject-path: "dist/*"
55+
56+
- uses: pypa/gh-action-pypi-publish@release/v1
57+
with:
58+
# Remember to tell (test-)pypi about this repo before publishing
59+
# Remove this line to publish to PyPI
60+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)