-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to begin aligning with
femto
(#67)
- Loading branch information
1 parent
bb46f26
commit 095c1ab
Showing
104 changed files
with
5,425 additions
and
8,707 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,12 +1,6 @@ | ||
## Description | ||
Provide a brief description of the PR's purpose here. | ||
|
||
## Todos | ||
Notable points that this PR has either accomplished or will accomplish. | ||
- [ ] TODO 1 | ||
|
||
## Questions | ||
- [ ] Question1 | ||
<!--- Provide a brief description of the PR's purpose here. --> | ||
|
||
## Status | ||
- [ ] Ready to go | ||
- [ ] Ready to go |
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 |
---|---|---|
|
@@ -5,83 +5,29 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
push: { branches: [ "main" ] } | ||
pull_request: { branches: [ "main" ] } | ||
|
||
jobs: | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.10' | ||
- name: Install the package | ||
run: | | ||
pip install -e . | ||
- name: Install isort / flake8 / black | ||
run: | | ||
pip install isort flake8 black | ||
- name: Run isort | ||
run: | | ||
isort --check-only absolv | ||
- name: Run black | ||
run: | | ||
black absolv --check | ||
- name: Run flake8 | ||
run: | | ||
flake8 absolv | ||
test: | ||
|
||
name: ${{ matrix.os }} python=${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest" ] | ||
python-version: [ "3.10" ] | ||
runs-on: ubuntu-latest | ||
container: condaforge/mambaforge:latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2.4.0 | ||
- uses: actions/checkout@v3.3.0 | ||
|
||
- name: Setup Conda Environment | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
environment-file: devtools/envs/base.yaml | ||
extra-specs: | | ||
python=${{ matrix.python-version }} | ||
- name: Install Package | ||
shell: bash -l {0} | ||
run: | | ||
pip install -e . | ||
- name: Conda Environment Information | ||
shell: bash -l {0} | ||
run: | | ||
conda info | ||
conda list | ||
apt update && apt install -y git make | ||
- name: Run Tests | ||
shell: bash -l {0} | ||
run: | | ||
pytest -v --cov=absolv --cov-report=xml --cov-report=term --color=yes absolv/tests/ | ||
make env | ||
make lint | ||
make test | ||
make docs-build | ||
- name: CodeCov | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v3.1.1 | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} |
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,51 +1,53 @@ | ||
name: docs | ||
name: Publish Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
- main | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
docs: | ||
deploy-docs: | ||
|
||
runs-on: ubuntu-latest | ||
container: condaforge/mambaforge:latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Prepare container | ||
run: | | ||
apt update && apt install -y git make | ||
- name: Setup Conda Environment | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
environment-file: docs/environment.yml | ||
extra-specs: | | ||
python=${{ matrix.python-version }} | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Install Package | ||
shell: bash -l {0} | ||
- name: Determine Version | ||
shell: bash | ||
run: | | ||
pip install -e . | ||
- name: Environment Information | ||
shell: bash -l {0} | ||
if [ "$GITHUB_REF" = "refs/heads/main" ]; then | ||
echo "VERSION=latest" >> $GITHUB_ENV | ||
elif [ "${GITHUB_REF#refs/tags/}" != "$GITHUB_REF" ]; then | ||
VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///') | ||
echo "VERSION=$VERSION stable" >> $GITHUB_ENV | ||
else | ||
echo "Invalid ref: $GITHUB_REF" | ||
exit 1 | ||
fi | ||
- name: Build and Deploy Documentation | ||
env: | ||
INSIDER_DOCS_TOKEN: ${{ secrets.INSIDER_DOCS_TOKEN }} | ||
run: | | ||
conda info | ||
conda list | ||
git config --global user.name 'GitHub Actions' | ||
git config --global user.email '[email protected]' | ||
git config --global --add safe.directory "$PWD" | ||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | ||
- name: Build 🔧 | ||
shell: bash -l {0} | ||
run: | | ||
git fetch --all --prune | ||
cd docs | ||
make env | ||
python compile-sass.py | ||
make html | ||
sed -i 's/# extensions/extensions/' mkdocs.yml | ||
- name: Deploy 🚀 | ||
if: github.ref == 'refs/heads/main' | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: docs/_build/html | ||
make docs-insiders INSIDER_DOCS_TOKEN="${INSIDER_DOCS_TOKEN}" | ||
make docs-deploy VERSION="$VERSION" |
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 |
---|---|---|
|
@@ -109,4 +109,6 @@ ENV/ | |
.idea | ||
|
||
# OSX | ||
.DS_Store | ||
.DS_Store | ||
|
||
.ruff_cache |
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,19 +1,15 @@ | ||
files: \.py$ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
|
||
- repo: local | ||
hooks: | ||
- id: isort | ||
name: Import formatting | ||
language: system | ||
entry: isort | ||
|
||
- id: black | ||
name: Code formatting | ||
language: system | ||
entry: black | ||
|
||
- id: flake8 | ||
name: Linting | ||
language: system | ||
entry: flake8 | ||
- repo: local | ||
hooks: | ||
- id: ruff | ||
name: Autoformat python code | ||
language: system | ||
entry: ruff | ||
args: [check] | ||
files: \.py$ |
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
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,6 +1 @@ | ||
include LICENSE | ||
include MANIFEST.in | ||
include versioneer.py | ||
|
||
graft absolv | ||
global-exclude *.py[cod] __pycache__ *.so | ||
global-exclude *.py[cod] __pycache__ *.so |
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,10 +1,36 @@ | ||
.PHONY: env | ||
PACKAGE_NAME := absolv | ||
|
||
CONDA_ENV_RUN=conda run --no-capture-output --name $(PACKAGE_NAME) | ||
|
||
TEST_ARGS := -v --cov=$(PACKAGE_NAME) --cov-report=term --cov-report=xml --junitxml=unit.xml --color=yes | ||
|
||
.PHONY: env lint format test docs-build docs-deploy docs-insiders | ||
|
||
env: | ||
mamba create -n absolv | ||
mamba env update -n absolv --file devtools/envs/base.yaml | ||
conda run --no-capture-output --name absolv pip install --no-deps -e . | ||
conda run --no-capture-output --name absolv pre-commit install | ||
mamba create --name $(PACKAGE_NAME) | ||
mamba env update --name $(PACKAGE_NAME) --file devtools/envs/base.yaml | ||
$(CONDA_ENV_RUN) pip install --no-deps -e . | ||
$(CONDA_ENV_RUN) pre-commit install || true | ||
|
||
lint: | ||
$(CONDA_ENV_RUN) ruff check $(PACKAGE_NAME) | ||
|
||
.PHONY: format | ||
format: | ||
pre-commit run --all-files | ||
$(CONDA_ENV_RUN) ruff format $(PACKAGE_NAME) | ||
$(CONDA_ENV_RUN) ruff check --fix --select I $(PACKAGE_NAME) | ||
|
||
test: | ||
$(CONDA_ENV_RUN) pytest -v $(TEST_ARGS) $(PACKAGE_NAME)/tests/ | ||
|
||
docs-build: | ||
$(CONDA_ENV_RUN) mkdocs build | ||
|
||
docs-deploy: | ||
ifndef VERSION | ||
$(error VERSION is not set) | ||
endif | ||
$(CONDA_ENV_RUN) mike deploy --push --update-aliases $(VERSION) | ||
|
||
docs-insiders: | ||
$(CONDA_ENV_RUN) pip install git+https://$(INSIDER_DOCS_TOKEN)@github.com/SimonBoothroyd/mkdocstrings-python.git \ | ||
git+https://$(INSIDER_DOCS_TOKEN)@github.com/SimonBoothroyd/griffe-pydantic.git@fix-inheritence-static |
Oops, something went wrong.