Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit e36a8d9
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 13:14:18 2024 +0000

    Update pytest.yml

commit f2c76eb
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 13:08:52 2024 +0000

    Update pytest.yml

commit 17b1736
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 13:06:25 2024 +0000

    Update requirements.txt

commit 87500b9
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 13:05:35 2024 +0000

    Attempt to fix long_description

commit 3b633d9
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 12:59:49 2024 +0000

    Delete _version.py

commit ce512cd
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 12:59:28 2024 +0000

    Update build process

commit ec03c7e
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 12:49:16 2024 +0000

    remove setuptools_scm

commit fc080be
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 12:47:21 2024 +0000

    Remove pylint

commit bf8eded
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 12:46:34 2024 +0000

    Update linter.yml

commit c286340
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 12:43:07 2024 +0000

    Update .pre-commit-config.yaml

commit 9158243
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 12:42:33 2024 +0000

    Update README.md

commit 5f6ee39
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 12:42:08 2024 +0000

    Update pytest.yml

commit a5d41ae
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 12:40:01 2024 +0000

    add .python-version

commit 6009dea
Author: Luke Shingles <[email protected]>
Date:   Sat Feb 17 12:34:21 2024 +0000

    Modernize packaging
  • Loading branch information
lukeshingles committed Feb 17, 2024
1 parent bb281e9 commit bee7f9b
Show file tree
Hide file tree
Showing 25 changed files with 693 additions and 602 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/black.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/deploypypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Upload Package to PyPI

on:
release:
types: [published, edited]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
cache: pip
python-version-file: .python-version

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
python3 -m pip install --upgrade setuptools setuptools_scm[toml] wheel twine build
- name: Build
run: |
python3 -m setuptools_scm
python3 -m build --sdist --wheel --outdir dist/ .
python3 -m twine check dist/*
- name: Publish to PyPI
run: |
python3 -m twine upload -r pypi -u __token__ -p ${{ secrets.PYPI_TOKEN }} --non-interactive dist/*
41 changes: 41 additions & 0 deletions .github/workflows/deploytestpypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Upload Package to TestPyPI

on:
push:
branches:
- '*'
tags:
- '*'
repository_dispatch:
types: [trigger_checks]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
cache: pip
python-version-file: .python-version

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
python3 -m pip install --upgrade setuptools setuptools_scm[toml] wheel twine build
- name: Build
run: |
python3 -m setuptools_scm
python3 -m build --sdist --wheel --outdir dist/ .
python3 -m twine check dist/*
- name: Publish to Test PyPI
run: |
python3 -m twine upload --skip-existing --verbose -r testpypi -u __token__ -p ${{ secrets.TESTPYPI_TOKEN }} --non-interactive dist/*
63 changes: 63 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: Linter

on:
push:
merge_group:
schedule:
- cron: 0 13 * * 1
#pull_request:
workflow_dispatch:
repository_dispatch:
types: [trigger_checks]

jobs:
pre-commit:
runs-on: macos-14
env:
RUFF_OUTPUT_FORMAT: github
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
cache: pip
python-version-file: .python-version

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip wheel mypy
python3 -m pip install -r requirements.txt
- name: Run pre-commit
run: |
pre-commit run --all-files
lint:
runs-on: macos-14
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
cache: pip
python-version-file: .python-version

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip wheel pylint mypy ruff
python3 -m pip install -r requirements.txt
- name: Run Ruff
run: ruff check --output-format=github .

- name: Run Ruff Format
run: ruff format --diff .

- name: Run mypy
run: |
mypy --install-types --non-interactive
62 changes: 62 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
name: Installation and pytest

on:
push:
merge_group:
schedule:
- cron: 0 13 * * 1
#pull_request:
workflow_dispatch:
repository_dispatch:
types: [trigger_checks]

jobs:
pytest:
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
# os: [macos-14]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

name: pytest python${{ matrix.python-version }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
cache: pip
python-version: ${{ matrix.python-version }}

- name: Install artistools
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .
- name: Test with pytest
run: pytest --cov=./ --cov-report=xml

- name: Report coverage
run: coverage report

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
# directory: ./coverage/reports/
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
verbose: true
85 changes: 0 additions & 85 deletions .github/workflows/pythonapp.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ target/
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
Expand Down Expand Up @@ -127,3 +124,5 @@ dmypy.json

# Pyre type checker
.pyre/

_version.py
59 changes: 59 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
args: [--maxkb=800]
- id: check-ast
- id: check-case-conflict
- id: check-builtin-literals
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: destroyed-symlinks
- id: fix-byte-order-marker
- id: forbid-new-submodules
- id: mixed-line-ending
args: [--fix=lf]
- id: name-tests-test
args: [--pytest-test-first]
- id: requirements-txt-fixer
# - id: trailing-whitespace

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies: [numpy, types-PyYAML, pandas>=2.0.3]
types: [python]
require_serial: true

# - repo: local
# hooks:
# - id: mypy
# name: mypy
# entry: mypy
# types: [python]
# language: python
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
Loading

0 comments on commit bee7f9b

Please sign in to comment.