Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare a new release #102

Merged
merged 7 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ name: Release
on:
push:
tags:
- '*'
- "*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up PDM
uses: pdm-project/[email protected]
with:
python-version: 3.7
- name: Build release
run: |
pdm build
- name: Upload release
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
- name: Publish release to PYPI
run: |
pip install twine
twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --verbose dist/*
- name: Publish release to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v1
- name: Set up PDM
uses: pdm-project/[email protected]
with:
python-version: 3.9
- name: Build release
run: |
pdm build
- name: Upload release
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
- name: Publish release to PYPI
run: |
pip install twine
twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --verbose dist/*
- name: Publish release to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136 changes: 68 additions & 68 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,83 +13,83 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: 3.11
- name: Cache Nox Virtualenvs
uses: actions/cache@v1
with:
path: .nox
key: ${{ runner.os }}-nox-${{ hashFiles('**/pdm.lock') }}
restore-keys: ${{ runner.os }}-nox
- name: Install nox
run: |
pip install nox
pdm config python.use_venv true
- uses: pre-commit/[email protected]
env:
SKIP: export_requirements_txt
- uses: actions/checkout@v1
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: 3.12
- name: Cache Nox Virtualenvs
uses: actions/cache@v1
with:
path: .nox
key: ${{ runner.os }}-nox-${{ hashFiles('**/pdm.lock') }}
restore-keys: ${{ runner.os }}-nox
- name: Install nox
run: |
pip install nox
pdm config python.use_venv true
- uses: pre-commit/[email protected]
env:
SKIP: export_requirements_txt
test:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v1
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
- name: Cache Nox Virtualenvs
uses: actions/cache@v1
with:
path: .nox
key: ${{ runner.os }}-${{ matrix.python-version }}-nox-${{ hashFiles('**/pdm.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.python-version }}-nox
- name: Install nox
run: |
pip install nox
pdm config python.use_venv true
- name: Test with coverage
run: |
make PYTHON=${{ matrix.python-version }} cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: main,unittest,${{ matrix.python-version }}
fail_ci_if_error: true
- uses: actions/checkout@v1
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
- name: Cache Nox Virtualenvs
uses: actions/cache@v1
with:
path: .nox
key: ${{ runner.os }}-${{ matrix.python-version }}-nox-${{ hashFiles('**/pdm.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.python-version }}-nox
- name: Install nox
run: |
pip install nox
pdm config python.use_venv true
- name: Test with coverage
run: |
make PYTHON=${{ matrix.python-version }} cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: main,unittest,${{ matrix.python-version }}
fail_ci_if_error: true
test-mypy-plugin:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v1
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
- name: Cache Nox Virtualenvs
uses: actions/cache@v1
with:
path: .nox
key: ${{ runner.os }}-${{ matrix.python-version }}-nox-${{ hashFiles('**/pdm.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.python-version }}-nox
- name: Install nox
run: |
pip install nox
pdm config python.use_venv true
- name: Test
run: |
make PYTHON=${{ matrix.python-version }} test-mypy-plugin
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: plugin-mypy,unittest,${{ matrix.python-version }}
fail_ci_if_error: true
- uses: actions/checkout@v1
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
- name: Cache Nox Virtualenvs
uses: actions/cache@v1
with:
path: .nox
key: ${{ runner.os }}-${{ matrix.python-version }}-nox-${{ hashFiles('**/pdm.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.python-version }}-nox
- name: Install nox
run: |
pip install nox
pdm config python.use_venv true
- name: Test
run: |
make PYTHON=${{ matrix.python-version }} test-mypy-plugin
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: plugin-mypy,unittest,${{ matrix.python-version }}
fail_ci_if_error: true
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,10 @@ dmypy.json
.pdm.toml
## MacOS
.DS_Store
## misc
.dream2nix/
.pdm-python
pdm.toml
result
.envrc
.direnv
142 changes: 73 additions & 69 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,74 @@
repos:
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.27.0
hooks:
- id: commitizen
stages:
- commit-msg
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-symlinks
- id: check-toml
- id: check-yaml
args: [--unsafe]
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: mixed-line-ending
args: [--fix=lf]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
- id: rst-backticks
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.3.*]
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear==23.5.*"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
files: data_extractor/.+\.py$
pass_filenames: false
entry: env PYTHONPATH=. mypy
args:
- data_extractor
- --show-traceback
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
hooks:
- id: doc8
- repo: local
hooks:
- id: build_readme
name: build_readme
description: Build README.rst
entry: nox -s build_readme
language: system
pass_filenames: false
types: [rst]
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.27.0
hooks:
- id: commitizen
stages:
- commit-msg
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-symlinks
- id: check-toml
- id: check-yaml
args: [--unsafe]
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: mixed-line-ending
args: [--fix=lf]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
- id: rst-backticks
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.3.*]
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear==23.5.*"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
files: data_extractor/.+\.py$
pass_filenames: false
entry: bash -c 'env PYTHONPATH=.:$PYTHONPATH mypy data_extractor --show-traceback'
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
hooks:
- id: doc8
- repo: local
hooks:
- id: build_readme
name: build_readme
description: Build README.rst
entry: nox -s build_readme
language: system
pass_filenames: false
types: [rst]
- id: export_requirements_txt
name: export_requirements_txt
description: create requirement file for python
entry: python3 scripts/export_requirements_txt.py
language: system
files: pdm.lock
pass_filenames: false
9 changes: 4 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
version: 2

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.12"

python:
install:
- requirements: requirements-docs.txt
- method: pip
path: .
- requirements: ./scripts/requirements-docs.txt
- path: .

sphinx:
builder: html
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ help:
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)

PYTHON = 3.11
PYTHON = 3.12
EXTRAS = lxml cssselect jsonpath-extractor jsonpath-rw jsonpath-rw-ext
DEV_EXTRAS = test test-mypy-plugin docs
EXTRAS_ARGS = $(if $(EXTRAS),-G,) $(subst $(SPACE),$(SPACE)-G$(SPACE),$(EXTRAS))
Expand Down
Loading
Loading