Skip to content

Commit 24c7594

Browse files
committed
feat: initial commit
0 parents  commit 24c7594

28 files changed

+2066
-0
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Please don't file issues directly, use one of our available templates:
2+
3+
Bugs: https://github.com/martibosch/pylandstats/issues/new?template=bug.md
4+
Feature Requests: https://github.com/martibosch/pylandstats/issues/new?template=feature.md
5+
6+
Thank you.

.github/ISSUE_TEMPLATES/bug.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- PyLandStats version:
2+
- Python version:
3+
- Operating System:
4+
5+
### Description
6+
7+
Describe what you were trying to get done.
8+
Tell us what happened, what went wrong, and what you expected to happen.
9+
10+
### What I Did
11+
12+
```
13+
Paste the command(s) you ran and the output.
14+
If there was a crash, please include the traceback here.
15+
```

.github/ISSUE_TEMPLATES/feature.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Description
2+
3+
Describe your feature request

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Config for Dependabot updates. See Documentation here:
2+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
3+
4+
version: 2
5+
updates:
6+
# Update GitHub actions in workflows
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
# Check for updates to GitHub Actions every weekday
10+
schedule:
11+
interval: "daily"

.github/workflows/release.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: build sdist and wheel
16+
run: pipx run build
17+
18+
- uses: actions/upload-artifact@v4
19+
with:
20+
path: dist/*
21+
22+
- name: check metadata
23+
run: pipx run twine check dist/*
24+
25+
publish_dev_build:
26+
needs: [build]
27+
runs-on: ubuntu-latest
28+
environment:
29+
name: testpypi
30+
permissions:
31+
# IMPORTANT: this permission is mandatory for trusted publishing
32+
id-token: write
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- uses: actions/download-artifact@v4
38+
with:
39+
name: artifact
40+
path: dist
41+
42+
- name: publish to test pypi
43+
uses: pypa/gh-action-pypi-publish@release/v1
44+
with:
45+
repository-url: https://test.pypi.org/legacy/
46+
skip-existing: true
47+
48+
release:
49+
needs: [publish_dev_build]
50+
runs-on: ubuntu-latest
51+
environment:
52+
name: pypi
53+
permissions:
54+
# IMPORTANT: this permission is mandatory for trusted publishing
55+
id-token: write
56+
# see https://github.com/softprops/action-gh-release/issues/236
57+
contents: write
58+
59+
# Steps represent a sequence of tasks that will be executed as part of the job
60+
steps:
61+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
62+
- uses: actions/checkout@v4
63+
64+
- name: update changelog
65+
id: changelog
66+
uses: requarks/changelog-action@v1
67+
with:
68+
token: ${{ github.token }}
69+
tag: ${{ github.ref_name }}
70+
if: github.event.ref != 'refs/tags/v0.1.0'
71+
72+
- name: create release
73+
uses: ncipollo/[email protected]
74+
with:
75+
allowUpdates: true
76+
draft: false
77+
makeLatest: true
78+
name: ${{ github.ref_name }}
79+
body: ${{ steps.changelog.outputs.changes }}
80+
token: ${{ github.token }}
81+
82+
- uses: actions/download-artifact@v4
83+
with:
84+
name: artifact
85+
path: dist
86+
87+
- name: publish to pypi
88+
uses: pypa/gh-action-pypi-publish@release/v1
89+
90+
- name: pre-commit on changelog
91+
uses: pre-commit/[email protected]
92+
with:
93+
extra_args: --files CHANGELOG.md
94+
# we only run this to format CHANGELOG.md so pre-commit will fail (yet format it)
95+
continue-on-error: true
96+
97+
- name: commit changelog
98+
uses: stefanzweifel/git-auto-commit-action@v5
99+
with:
100+
branch: main
101+
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
102+
file_pattern: CHANGELOG.md

.github/workflows/tests.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches:
8+
- "*"
9+
10+
jobs:
11+
test:
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
python-version: ["3.10", "3.11", "3.12", "3.13"]
16+
include:
17+
- os: macos-latest
18+
python-version: "3.13"
19+
- os: windows-latest
20+
python-version: "3.13"
21+
22+
runs-on: ${{ matrix.os }}
23+
defaults:
24+
run:
25+
shell: bash -l {0}
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- uses: mamba-org/setup-micromamba@v2
31+
with:
32+
environment-name: test-env
33+
create-args: >-
34+
python=${{ matrix.python-version }}
35+
pip
36+
37+
- name: install dependencies
38+
run: pip install tox tox-gh-actions
39+
40+
- name: test with tox
41+
run: tox
42+
env:
43+
CONDA_EXE: mamba
44+
45+
- name: upload coverage reports to Codecov
46+
uses: codecov/codecov-action@v5
47+
with:
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
50+
- name: list files
51+
run: ls -l .

.gitignore

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
58+
# Flask stuff:
59+
instance/
60+
.webassets-cache
61+
62+
# Scrapy stuff:
63+
.scrapy
64+
65+
# Sphinx documentation
66+
docs/_build/
67+
68+
# PyBuilder
69+
target/
70+
71+
# Jupyter Notebook
72+
.ipynb_checkpoints
73+
74+
# pyenv
75+
.python-version
76+
77+
# celery beat schedule file
78+
celerybeat-schedule
79+
80+
# SageMath parsed files
81+
*.sage.py
82+
83+
# dotenv
84+
.env
85+
86+
# virtualenv
87+
.venv
88+
venv/
89+
ENV/
90+
91+
# Spyder project settings
92+
.spyderproject
93+
.spyproject
94+
95+
# Rope project settings
96+
.ropeproject
97+
98+
# mkdocs documentation
99+
/site
100+
101+
# mypy
102+
.mypy_cache/
103+
104+
# IDE settings
105+
.vscode/
106+
107+
# mkdocs build dir
108+
site/
109+
110+
# vscode extension - local history
111+
.history/

.pre-commit-config.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
ci:
2+
autofix_commit_msg: "style(pre-commit.ci): auto fixes from pre-commit hooks"
3+
autoupdate_commit_msg: "style(pre-commit.ci): pre-commit autoupdate"
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v5.0.0
8+
hooks:
9+
- id: trailing-whitespace
10+
- id: end-of-file-fixer
11+
- id: check-yaml
12+
13+
- repo: https://github.com/commitizen-tools/commitizen
14+
rev: v4.4.1
15+
hooks:
16+
- id: commitizen
17+
18+
- repo: https://github.com/executablebooks/mdformat
19+
rev: 0.7.22
20+
hooks:
21+
- id: mdformat
22+
additional_dependencies:
23+
- mdformat-gfm
24+
- mdformat-ruff
25+
26+
- repo: https://github.com/pappasam/toml-sort
27+
rev: v0.24.2
28+
hooks:
29+
- id: toml-sort-fix
30+
args: ["--in-place"]
31+
32+
- repo: https://github.com/adrienverge/yamllint.git
33+
rev: v1.37.0
34+
hooks:
35+
- id: yamllint
36+
args: ["-d relaxed"]
37+
38+
- repo: https://github.com/python-jsonschema/check-jsonschema
39+
rev: 0.32.1
40+
hooks:
41+
- id: check-github-workflows
42+
43+
- repo: https://github.com/rhysd/actionlint
44+
rev: v1.7.7
45+
hooks:
46+
- id: actionlint
47+
48+
- repo: https://github.com/asottile/pyupgrade
49+
rev: v3.19.1
50+
hooks:
51+
- id: pyupgrade
52+
53+
- repo: https://github.com/codespell-project/codespell
54+
rev: v2.4.1
55+
hooks:
56+
- id: codespell
57+
additional_dependencies:
58+
- tomli
59+
60+
- repo: https://github.com/astral-sh/ruff-pre-commit
61+
rev: v0.11.2
62+
hooks:
63+
- id: ruff
64+
args: ["--fix"]
65+
- id: ruff-format
66+
67+
- repo: https://github.com/kynan/nbstripout
68+
rev: 0.8.1
69+
hooks:
70+
- id: nbstripout
71+
args: ["--keep-output"]

.readthedocs.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: mambaforge-4.10
7+
8+
conda:
9+
environment: docs/environment.yml
10+
11+
python:
12+
install:
13+
- method: pip
14+
path: .
15+
16+
sphinx:
17+
configuration: docs/conf.py

0 commit comments

Comments
 (0)