-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor a bit, introduce setuptools-scm, liniting, preparing to publ…
…ish package
- Loading branch information
Showing
5 changed files
with
152 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
name: "Publish PyPi package when a new tag is pushed" | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
# https://docs.pypi.org/trusted-publishers/using-a-publisher/ | ||
jobs: | ||
pypi-publish: | ||
name: "upload release to PyPI" | ||
runs-on: "ubuntu-latest" | ||
environment: "pypi-publish" | ||
permissions: | ||
id-token: "write" | ||
steps: | ||
# https://github.com/pypa/sampleproject/blob/main/.github/workflows/release.yml | ||
- name: "Checkout" | ||
uses: "actions/checkout@v3" | ||
- name: "Set up Python" | ||
uses: "actions/setup-python@v4" | ||
with: | ||
python-version: '3.11' | ||
- name: "Install build dependencies" | ||
run: "python -m pip install -U setuptools wheel build" | ||
- name: "Build" | ||
run: "python -m build ." | ||
- name: "Publish package distributions to PyPI" | ||
uses: "pypa/gh-action-pypi-publish@release/v1" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
default_language_version: | ||
python: "python3" | ||
repos: | ||
- repo: "https://github.com/astral-sh/ruff-pre-commit" | ||
rev: "v0.7.3" | ||
hooks: | ||
- id: "ruff" | ||
args: ["--fix"] | ||
- id: "ruff-format" | ||
- repo: "https://github.com/pre-commit/mirrors-mypy" | ||
rev: 'v1.13.0' | ||
hooks: | ||
- id: "mypy" | ||
additional_dependencies: | ||
- "exifread" | ||
- "httpx" | ||
- "pillow" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
requires = ["setuptools>=64", "setuptools_scm>=8"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
|
||
[project] | ||
authors = [ | ||
{email = "[email protected]"}, | ||
|
@@ -16,11 +17,11 @@ dependencies = [ | |
"httpx==0.27.2", | ||
"pillow==11.0.0", | ||
] | ||
description = "BornHack Media Archive Python Client Library" | ||
name = "bma-client" | ||
version = "0.1" | ||
description = "BornHack Media Archive Python Client Library" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
requires-python = ">=3.11" | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
|
@@ -30,6 +31,8 @@ dev = [ | |
[project.urls] | ||
homepage = "https://github.com/bornhack/bma-client-python" | ||
|
||
[tool.setuptools_scm] | ||
|
||
[tool.setuptools] | ||
package-dir = {"" = "src"} | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters