-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from openzim/python_bootstrap
Python bootstrap
- Loading branch information
Showing
52 changed files
with
1,249 additions
and
415 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,11 @@ | ||
## Rationale | ||
|
||
[//]: # (Briefly explain the reason behind this change.) | ||
|
||
<!-- | ||
Mention fixed issues that will be closed automatically with some "Fix #xxx" | ||
--> | ||
|
||
## Changes | ||
|
||
[//]: # (Summarize what has changed.) |
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,15 @@ | ||
daysUntilClose: false | ||
staleLabel: stale | ||
|
||
issues: | ||
daysUntilStale: 60 | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be now be reviewed manually. Thank you | ||
for your contributions. | ||
pulls: | ||
daysUntilStale: 7 | ||
markComment: > | ||
This pull request has been automatically marked as stale because it has not had | ||
recent activity. It will be now be reviewed manually. Thank you | ||
for your contributions. |
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,43 @@ | ||
name: Build and upload to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
id-token: write # mandatory for PyPI trusted publishing | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Build packages | ||
run: | | ||
pip install -U pip build | ||
python -m build --sdist --wheel | ||
- name: Upload to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1.8 | ||
|
||
- name: Build and push Docker image | ||
uses: openzim/docker-publish-action@v10 | ||
with: | ||
image-name: openzim/ted | ||
tag-pattern: /^v([0-9.]+)$/ | ||
latest-on-tag: true | ||
restrict-to: openzim/ted | ||
registries: ghcr.io | ||
credentials: | ||
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }} | ||
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }} | ||
repo_description: auto | ||
repo_overview: auto | ||
|
18 changes: 8 additions & 10 deletions
18
.github/workflows/docker.yml → .github/workflows/PublishDockerDevImage.yaml
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,25 +1,23 @@ | ||
name: Docker | ||
name: Publish Docker dev image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build-and-push: | ||
name: Deploy Docker Image | ||
publish: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Build and push | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build and push Docker image | ||
uses: openzim/docker-publish-action@v10 | ||
with: | ||
image-name: openzim/ted | ||
on-master: dev | ||
tag-pattern: /^v([0-9.]+)$/ | ||
latest-on-tag: true | ||
manual-tag: dev | ||
latest-on-tag: false | ||
restrict-to: openzim/ted | ||
registries: ghcr.io | ||
credentials: | ||
|
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,34 @@ | ||
name: QA | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-qa: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Install dependencies (and project) | ||
run: | | ||
pip install -U pip | ||
pip install -e .[lint,scripts,test,check] | ||
- name: Check black formatting | ||
run: inv lint-black | ||
|
||
- name: Check ruff | ||
run: inv lint-ruff | ||
|
||
- name: Check pyright | ||
run: inv check-pyright |
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,62 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Install dependencies (and project) | ||
run: | | ||
pip install -U pip | ||
pip install -e .[test,scripts] | ||
- name: Run the tests | ||
run: inv coverage --args "-vvv" | ||
|
||
- name: Upload coverage report to codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
build_python: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Ensure we can build Python targets | ||
run: | | ||
pip install -U pip build | ||
python3 -m build --sdist --wheel | ||
build_docker: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Ensure we can build the Docker image | ||
run: | | ||
docker build -t testimage . | ||
- name: Ensure we can start the Docker image | ||
run: | | ||
docker run --rm testimage |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.