Skip to content

Commit

Permalink
👷 hatch
Browse files Browse the repository at this point in the history
  • Loading branch information
juftin authored Dec 15, 2023
1 parent c966c57 commit 632fcee
Show file tree
Hide file tree
Showing 36 changed files with 1,125 additions and 1,789 deletions.
19 changes: 0 additions & 19 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

15 changes: 7 additions & 8 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Github Workspace
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch -v env create
python -m pip install -q --upgrade pip wheel
python -m pip install -q hatch pre-commit
hatch --version
- name: Declare Version Variable
run: |
Expand All @@ -38,7 +37,7 @@ jobs:
echo PACKAGE_NAME=${PACKAGE_NAME} >> $GITHUB_ENV
- name: Docker Image Building and Publishing
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
push: false
tags: juftin/${{ env.PACKAGE_NAME }}:latest
25 changes: 12 additions & 13 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Github Workspace
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python Environment 3.11
uses: actions/setup-python@v4
- name: Set up Python Environment
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch -v env create
python -m pip install --upgrade pip wheel
python -m pip install -q hatch pre-commit
hatch --version
- name: Lint
id: lint
continue-on-error: true
run: |
echo "::add-matcher::.github/matchers/flake8.json"
hatch run lint
echo "::add-matcher::.github/workflows/matchers/flake8.json"
hatch run lint:style
echo "::remove-matcher owner=flake8::"
- name: Code Checker
- name: Type Checking
id: check
continue-on-error: true
run: |
echo "::add-matcher::.github/matchers/mypy.json"
hatch run check
echo "::add-matcher::.github/workflows/matchers/mypy.json"
hatch run lint:typing
echo "::remove-matcher owner=mypy::"
- name: Raise Errors For Linting Failures
- name: Raise Errors For Failures
if: |
steps.lint.outcome != 'success' ||
steps.check.outcome != 'success'
steps.check.outcome != 'success'
run: |
echo "Lint: ${{ steps.lint.outcome }}"
echo "Check: ${{ steps.check.outcome }}"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 11 additions & 13 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch -v env create
python -m pip install -q hatch pre-commit
hatch --version
- name: Build package
run: |
hatch build
- name: Publish package on PyPI
uses: pypa/gh-action-pypi-publish@v1.8.6
uses: pypa/gh-action-pypi-publish@v1.8.11
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
Expand All @@ -40,23 +39,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch -v env create
python -m pip install -q --upgrade pip wheel
python -m pip install -q hatch pre-commit
hatch --version
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v2
with:
Expand All @@ -70,7 +68,7 @@ jobs:
echo PACKAGE_NAME=${PACKAGE_NAME} >> $GITHUB_ENV
- name: Docker Image Building and Publishing
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
push: true
tags: juftin/${{ env.PACKAGE_NAME }}:latest,juftin/${{ env.PACKAGE_NAME }}:${{ env.PACKAGE_VERSION }}
26 changes: 15 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,28 @@ jobs:
name: Release
if: github.repository_owner == 'juftin'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch -v env create
python -m pip install -q hatch pre-commit
hatch --version
- name: Release
run: hatch run semantic-release
run: hatch run gen:release
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
GIT_AUTHOR_NAME: github-actions[bot]
Expand All @@ -49,26 +54,25 @@ jobs:
git push --set-upstream origin gh-pages || true
git checkout main --
- name: Checkout gh-pages Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/github-pages
ref: gh-pages
fetch-depth: 0
- name: Set up Python Environment
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Hatch
working-directory: ${{ github.workspace }}/main
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch -v env create
hatch --version
- name: Documentation Generation
working-directory: ${{ github.workspace }}/main
run: |
hatch run docs-build
hatch run docs:build
- name: Setup Git Config
run: |
git config --global user.name "github-actions[bot]"
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,27 @@ jobs:
- {name: Python 3.10, python: '3.10'}
- {name: Python 3.9, python: '3.9'}
- {name: Python 3.8, python: '3.8'}
concurrency:
group: ${{ github.workflow }}-${{ matrix.python }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Set up Github Workspace
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python Environment ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
python -m pip install -q --upgrade pip wheel
python -m pip install -q hatch pre-commit
hatch --version
- name: Test Suite
run: |
echo "::add-matcher::.github/matchers/python.json"
hatch run +py=${{ matrix.python }} test:test
echo "::add-matcher::.github/workflows/matchers/python.json"
hatch run +py=${{ matrix.python }} all:cov
echo "::remove-matcher owner=python::"
env:
VCR_RECORD_MODE: none
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ celerybeat.pid
*.sage.py

# Environments
*.env
.env
.venv
env/
venv/
Expand Down Expand Up @@ -133,13 +133,9 @@ dmypy.json

# IDE Files
.idea/
/env.bash

# NodeJS
# Node.js
node_modules/

# Lunchable Data
lunchable/data/

# Requirements Files
requirements/*.bak
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ repos:
- id: format
name: format
description: Runs Code Auto-Formatters
entry: hatch run format
entry: hatch run lint:fmt
language: system
pass_filenames: false
- id: lint
name: lint
description: Runs Code Linters
entry: hatch run format
entry: hatch run lint:style
language: system
pass_filenames: false
require_serial: false
61 changes: 0 additions & 61 deletions .releaserc.js

This file was deleted.

Loading

0 comments on commit 632fcee

Please sign in to comment.