Skip to content
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
30 changes: 21 additions & 9 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,37 @@ concurrency:

jobs:
build:
name: Build source distribution
name: Build distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Build the sdist
python-version: "3.9"
- name: Install build dependencies
run: |
python setup.py sdist
python -m pip install --upgrade pip
python -m pip install build
- name: Build distributions
run: |
python -m build
- name: Check the sdist installs and imports
run: |
mkdir -p test-sdist
cd test-sdist
python -m venv venv-sdist
venv-sdist/bin/python -m pip install ../dist/etuples-*.tar.gz
- uses: actions/upload-artifact@v2
venv-sdist/bin/python -c "import etuples; print(etuples.__version__)"
- name: Check the wheel installs and imports
run: |
mkdir -p test-wheel
cd test-wheel
python -m venv venv-wheel
venv-wheel/bin/python -m pip install ../dist/etuples-*.whl
venv-wheel/bin/python -c "import etuples; print(etuples.__version__)"
- uses: actions/upload-artifact@v4
with:
name: artifact
path: dist/*
Expand All @@ -47,11 +59,11 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_secret }}
62 changes: 33 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
outputs:
changes: ${{ steps.changes.outputs.src }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
Expand All @@ -37,21 +37,23 @@ jobs:
- *python
- '.github/**/*.yml'
- 'setup.cfg'
- 'pyproject.toml'
- 'requirements.txt'
- '.coveragerc'
- '.pre-commit-config.yaml'
- 'coverage.xml'

style:
name: Check code style
needs: changes
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.changes == 'true' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: pre-commit/action@v2.0.0
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.13
- uses: pre-commit/action@v3.0.0

test:
needs:
Expand All @@ -62,27 +64,28 @@ jobs:
strategy:
matrix:
python-version:
- 3.8
- 3.9
- '3.10'
- '3.11'
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest -v tests/ --cov=etuples --cov-report=xml:./coverage.xml
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: run-${{ matrix.python-version }}
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest -v tests/ --cov=etuples --cov-report=xml:./coverage.xml
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: run-${{ matrix.python-version }}

all-checks:
if: ${{ always() }}
Expand All @@ -100,7 +103,8 @@ jobs:
if: ${{ needs.changes.outputs.changes == 'true' && needs.all-checks.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
31 changes: 16 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
exclude: |
(?x)^(
versioneer\.py|
etuples/_version\.py|
doc/.*|
bin/.*
)$
(?x)^(
doc/.*|
bin/.*
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: debug-statements
- id: check-merge-conflict
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.12.1
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/humitos/mirrors-autoflake.git
rev: v1.1
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
hooks:
- id: autoflake
exclude: |
(?x)^(
.*/?__init__\.py|
)$
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
args:
- --in-place
- --remove-all-unused-imports
- --remove-unused-variables
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.0
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies:
- types-setuptools
- types-setuptools
28 changes: 26 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
include versioneer.py
include etuples/_version.py
# Exclude entire directories
prune .github
prune .pytest_cache
prune .tox
prune .nox
prune build
prune dist
prune .ropeproject
prune .vscode
prune .idea
prune .venv
prune venv
prune env

# Exclude file patterns
global-exclude .DS_Store
global-exclude __pycache__
global-exclude *.py[cod]
global-exclude *.so
global-exclude .git*
global-exclude .coverage
global-exclude *.egg-info
global-exclude *.swp
global-exclude *.swo
global-exclude *~
global-exclude .env
6 changes: 3 additions & 3 deletions etuples/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from ._version import get_versions
import importlib.metadata

from .core import etuple
from .dispatch import apply, arguments, etuplize, operator, rands, rator, term

__version__ = get_versions()["version"]
del get_versions
__version__ = importlib.metadata.version("etuples")
Loading