Skip to content

Commit

Permalink
Merge pull request #16 from ocefpaf/GHA
Browse files Browse the repository at this point in the history
Update GHA
  • Loading branch information
callumrollo authored Mar 13, 2023
2 parents 3b3326c + 4372813 commit 7670e3c
Show file tree
Hide file tree
Showing 12 changed files with 293 additions and 169 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "Bot"
51 changes: 0 additions & 51 deletions .github/workflows/publish.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish to PyPI

on:
pull_request:
push:
branches:
- main
release:
types:
- published

jobs:
packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
shell: bash

- name: Install build tools
run: |
python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine
shell: bash

- name: Build binary wheel
run: python -m build --sdist --wheel . --outdir dist

- name: CheckFiles
run: |
ls dist
shell: bash

- name: Test wheels
run: |
cd dist && python -m pip install *.whl
python -m twine check *
shell: bash

- name: Publish a Python distribution to PyPI
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
38 changes: 0 additions & 38 deletions .github/workflows/pythonpackage.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests

on:
pull_request:
push:
branches: [main]

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false

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

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@v15
with:
environment-file: false

- name: Python ${{ matrix.python-version }}
shell: bash -l {0}
run: >
micromamba create --name TEST python=${{ matrix.python-version }} pytest --file requirements.txt --channel conda-forge
&& micromamba activate TEST
&& python -m pip install -e . --no-deps --force-reinstall
- name: Tests
shell: bash -l {0}
run: >
micromamba activate TEST
&& python -m pytest -rxs tests/
49 changes: 49 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
exclude: cmcrameri/cmaps

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-ast
- id: debug-statements
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-added-large-files
- id: requirements-txt-fixer
- id: file-contents-sorter
files: requirements-dev.txt

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.254
hooks:
- id: ruff

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

- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
hooks:
- id: blackdoc

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
args:
- --ignore-words-list=buda

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: monthly
skip: []
submodules: false
4 changes: 1 addition & 3 deletions cmcrameri/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@
See README.md for an overview and instructions.
"""
from __future__ import absolute_import

from . import cm
from .cm import show_cmaps


__all__ = (
"cm",
"show_cmaps",
)


__authors__ = ['Callum Rollo <c.rollo@outlook.com>']
__authors__ = ["Callum Rollo <c.rollo@outlook.com>"]

__version__ = "1.4"

Expand Down
Loading

0 comments on commit 7670e3c

Please sign in to comment.