Skip to content

Commit

Permalink
chore: clean repo (#31)
Browse files Browse the repository at this point in the history
* feat: update pre-commit config

* remove .flake8 file

* updated .travis.yml python version

* removed changelog and makefile

* updated pyproject.toml and poetry.lock

* apply formatters

* remove .tools-version file

* remove docs directory

* update pre-commit hooks

* chore: bump python versions in workflow

* change classifiers
  • Loading branch information
JTaeuber authored Dec 9, 2024
1 parent 741f0e5 commit 89fcf08
Show file tree
Hide file tree
Showing 33 changed files with 333 additions and 1,208 deletions.
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/issue-template.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
name: Issue template
about: The general template for issues
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

<!--
Use this issue template for pointing out a general issue.
-->

## Issue

<!--
Briefly describe the issue.
-->


### Problem to solve

<!-- Include the following detail as necessary:
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/build-publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@ name: Build and Publish Python Package
on:
push:
tags:
- '*'
- "*"

jobs:
build-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install poetry
run: pip install poetry
- name: Build Wheel
run: poetry build -f wheel
- name: Upload Wheel
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*
- name: Check Version Format in Tag
if: startsWith(github.ref, 'refs/tags/v')
uses: nowsprinting/[email protected]
id: check-version
with:
prefix: 'v'
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
pip install twine
twine upload dist/*
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install poetry
run: pip install poetry
- name: Build Wheel
run: poetry build -f wheel
- name: Upload Wheel
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*
- name: Check Version Format in Tag
if: startsWith(github.ref, 'refs/tags/v')
uses: nowsprinting/[email protected]
id: check-version
with:
prefix: "v"
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
pip install twine
twine upload dist/*
4 changes: 2 additions & 2 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
pip install poetry
Expand Down
61 changes: 37 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
fail_fast: false
fail_fast: true
default_stages: [pre-commit, pre-push]
repos:
# meta
Expand All @@ -12,38 +12,54 @@ repos:
# formatters

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
rev: v3.14.0
hooks:
- id: reorder-python-imports

- repo: https://github.com/ambv/black
rev: 23.3.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: black
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/asottile/pyupgrade
rev: v3.6.0
rev: v3.19.0
hooks:
- id: pyupgrade
stages: [pre-push]

# linters

- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
rev: 1.8.0
hooks:
- id: bandit
args: ["-x", "tests"]
stages: [pre-push]

#- repo: https://github.com/PyCQA/pydocstyle
#rev: 5.0.2
#hooks:
#- id: pydocstyle
#args: ["--ignore=D10,D21,D202"]

- repo: local
hooks:
- id: prevent-todo-comments
name: prevent todo comments
entry: '# *(TODO|FIXME)\b' # matches a python comment beginning with "TODO" or "FIXME"
language: pygrep
files: \.py$

- id: prevent-too-small-headings
name: prevent too small headings
entry: "^#{5,} " # matches a h5 or smaller markdown heading
language: pygrep
files: \.md$

- id: prevent-invalid-alert-types
name: prevent invalid alert types
entry: '(?i)^> \[!(?!\b(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION)\b).+\]' # matches a github markdown callout/alert that doesn't use one of the supported keywords
language: pygrep
files: \.md$

- id: safety
name: safety
entry: safety
Expand All @@ -62,24 +78,19 @@ repos:
stages: [pre-push]

- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
rev: v1.35.1
hooks:
- id: yamllint
args: ["--strict", "-d", "{rules: {line-length: {max: 180}}}"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies: [types-PyYAML, types-requests]

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

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
Expand All @@ -96,15 +107,17 @@ repos:
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
# - id: rst-backticks
- id: python-use-type-annotations
- id: python-no-log-warn
- id: python-no-eval
- id: python-check-mock-methods
- id: python-check-blanket-noqa

# commit-msg
# http://jorisroovers.com/gitlint/#using-gitlint-through-pre-commit
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.4.2
hooks:
- id: prettier
files: \.md$

- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
Expand Down
1 change: 0 additions & 1 deletion .tools-version

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dist: bionic
language: python
python:
- "3.7"
- "3.9"
install:
- pip install poetry
script:
Expand Down
134 changes: 0 additions & 134 deletions CHANGELOG.md

This file was deleted.

Loading

0 comments on commit 89fcf08

Please sign in to comment.