Skip to content

Commit

Permalink
MAINT: remove performance comparison utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgepiloto authored Mar 17, 2023
2 parents 1b7e036 + b7f60d5 commit fc1e248
Show file tree
Hide file tree
Showing 31 changed files with 133 additions and 1,103 deletions.
192 changes: 64 additions & 128 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI/CD
name: CI
on:
pull_request:
branches:
Expand All @@ -11,7 +11,9 @@ on:
repository_dispatch:

env:
MAIN_PYTHON_VERSION : '3.10'
MAIN_PYTHON_VERSION: '3.10'
DOCUMENTATION_CNAME: 'lamberthub.docs.jorgemartinez.space'
LIBRARY_NAME: 'lamberthub'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -21,7 +23,7 @@ concurrency:
jobs:

label-syncer:
name: Labels
name: "Sync labels"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -30,7 +32,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

labeler:
name: Labeler
name: "Labeler"
needs: [label-syncer]
permissions:
contents: read
Expand Down Expand Up @@ -73,163 +75,97 @@ jobs:
with:
labels: bug

style:
name: Code Style
code-style:
name: "Code style"
runs-on: ubuntu-latest
needs: labeler
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Run style checks
run: tox -e style

docs-style:
name: Documentation Style Check
- uses: pyansys/actions/code-style@v4

doc-style:
name: "Doc style"
runs-on: ubuntu-latest
needs: labeler
steps:
- uses: actions/checkout@v3

- name: Running Vale
uses: errata-ai/vale-action@reviewdog
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- uses: pyansys/actions/doc-style@v4
with:
files: doc
reporter: github-pr-check
level: error
filter_mode: nofilter
fail_on_error: true
vale_flags: "--config=doc/.vale.ini"
token: ${{ secrets.GITHUB_TOKEN }}

tests:
name: Tests
name: "Tests"
runs-on: ${{ matrix.os }}
needs: [style]
needs: code-style
strategy:
matrix:
os: [ubuntu-latest]
cfg:
- {python-version: "3.7", toxenv: "py37"}
- {python-version: "3.8", toxenv: "py38"}
- {python-version: "3.9", toxenv: "py39"}
- {python-version: "3.10", toxenv: "py310-cov"}
- {python-version: '3.8', extra-args: ''}
- {python-version: '3.9', extra-args: ''}
- {python-version: '3.10', extra-args: '--cov=lamberthub --cov-report=term --cov-report=html:.cov/html'}
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.cfg.python-version }}
uses: actions/setup-python@v4
- name: "Run tests"
uses: pyansys/actions/tests-pytest@v4
with:
python-version: ${{ matrix.cfg.python-version }}

- name: Install dependencies
run: python -m pip install --upgrade pip tox

- name: Run Tox
run: tox -e ${{ matrix.cfg.toxenv }}
pytest-extra-args: ${{ matrix.cfg.extra-args }}

- name: Upload coverage to Codecov
- name: "Upload coverage"
uses: codecov/codecov-action@v2
if: matrix.cfg.python-version == '3.10' && matrix.os == 'ubuntu-latest'
if: matrix.cfg.python-version == env.MAIN_PYTHON_VERSION && matrix.os == 'ubuntu-latest'

docs:
name: Docs
doc-build:
name: "Doc build"
runs-on: ubuntu-latest
needs: [docs-style]
needs: doc-style
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: Install dependencies
run: |
sudo apt-get install pandoc texlive
python -m pip install --upgrade pip tox
- uses: pyansys/actions/doc-build@v4

- name: Generate the documentation with tox
run: tox -e doc

- name: Upload HTML Documentation
uses: actions/upload-artifact@v2
with:
name: HTML-Documentation
path: .tox/doc_out

- name: Deploy dev documentation
run: |
curl -XPOST -u "${{ secrets.USERNAME }}:${{ secrets.PAT_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: application/json" https://api.github.com/repos/jorgepiloto/jorgepiloto.github.io/actions/workflows/publish.yml/dispatches \
--data '{"ref": "main"}' \
--fail
build:
name: Build
build-library:
name: "Build library"
runs-on: ubuntu-latest
needs: [tests, docs]
needs: [doc-build, tests]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
- uses: pyansys/actions/build-library@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
library-name: ${{ env.LIBRARY_NAME }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip build twine
- name: Build wheel and sdist
run: |
python -m build && python -m twine check dist/*
- name: Upload wheel and sdist to artifacts
uses: actions/upload-artifact@v2
doc-deploy-dev:
name: "Deploy development documentation"
runs-on: ubuntu-latest
needs: build-library
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags')
steps:
- uses: pyansys/actions/doc-deploy-dev@v4
with:
name: lamberthub
path: dist/
retention-days: 7
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}

release:
name: Release
name: "Release"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [build]
needs: build-library
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/download-artifact@v2

- name: Set up Python
uses: actions/setup-python@v4
- name: "Release to the public PyPI repository"
uses: pyansys/actions/release-pypi-public@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
library-name: ${{ env.LIBRARY_NAME }}
twine-username: "__token__"
twine-token: ${{ secrets.PYPI_TOKEN }}

- name: Display structure of downloaded files
run: ls -R
- name: Install dependencies
run: |
python -m pip install --upgrade pip twine
- name: "Release to GitHub"
uses: pyansys/actions/release-github@v4
with:
library-name: ${{ env.LIBRARY_NAME }}

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m twine upload --skip-existing ./**/*.whl
python -m twine upload --skip-existing ./**/*.tar.gz
- name: Publish to GitHub
uses: softprops/action-gh-release@v1
doc-deploy-stable:
name: "Deploy stable documentation"
runs-on: ubuntu-latest
needs: release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
steps:
- uses: pyansys/actions/doc-deploy-stable@v4
with:
files: |
./**/*.whl
./**/*.tar.gz
cname: ${{ env.LIBRARY_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ coverage.xml
.scrapy

# Sphinx documentation
docs/_build/
doc/_build/

# PyBuilder
target/
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
repos:

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.4
hooks:
- id: codespell
args: ["--skip", "*.css"]
Expand Down
6 changes: 5 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPHINXBUILD = sphinx-build
PAPER =
SRCDIR = source
EXAMPLESDIR = tutorials
BUILDDIR = build
BUILDDIR = _build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
Expand Down Expand Up @@ -180,3 +180,7 @@ pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

pdf:
mkdir -p $(BUILDDIR)/latex
touch $(BUILDDIR)/latex/documentation.pdf
Loading

0 comments on commit fc1e248

Please sign in to comment.