Skip to content

Commit

Permalink
Migrate to hatch (#149)
Browse files Browse the repository at this point in the history
- Change build-system to hatch/hatchling
- Updated dependencies (Closes #142 #143 #145 #147 #148)
- Updated editorconfig and .gitattributes
- Updated readthedocs build config
- Add Py3.11 support
  • Loading branch information
Buried-In-Code authored Nov 25, 2022
1 parent 28588db commit eb3cf5d
Show file tree
Hide file tree
Showing 39 changed files with 4,023 additions and 4,987 deletions.
44 changes: 28 additions & 16 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
root = true

[*]
charset = UTF-8
end_of_line = CRLF
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100

[*.bat]
indent_style = tab

[*.cs]
indent_size = 4
indent_style = tab
insert_final_newline = false
max_line_length = 100
tab_width = 4

[{*.bash,*.sh,*.zsh}]
indent_size = 2
tab_width = 2
[*.java]
indent_size = 4
indent_style = tab
insert_final_newline = false

[{*.har,*.json}]
indent_size = 2
tab_width = 2
[*.json]
insert_final_newline = false

[{*.markdown,*.md}]
indent_style = space
[*.md]
trim_trailing_whitespace = false

[{*.py,*.pyw}]
indent_style = space
[*.py]
indent_size = 4

[{*.xml,*.xsd}]
indent_size = 4
indent_style = tab
insert_final_newline = false

[{*.yaml,*.yml}]
indent_size = 2
tab_width = 2
indent_style = tab
4 changes: 2 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
max-line-length = 100
extend-ignore = D107,E203,W503
max-complexity = 18
max-line-length = 100
select = B,C,D,E,F,W,T4,B9
extend-ignore = E203,W503,D107
60 changes: 57 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
# Don't do text manipulations (line ending changes). Tests require
# unchanged files.
* -text
* text=auto

.gitattributes export-ignore
.gitignore export-ignore

*.md text diff=markdown
*.rtf diff=astextplain
*.sql text
*.txt text

*.jpg binary
*.png binary

*.bash text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.fish text eol=lf
*.ps1 text eol=crlf
*.sh text eol=lf
*.zsh text eol=lf

*.csv text
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text

*.7z binary
*.gz binary
*.tar binary
*.tgz binary
*.zip binary

# C#
*.cs text diff=csharp
*.cshtml text diff=html
*.csproj text eol=crlf
*.csx text diff=csharp
*.sln text eol=crlf

# Java
*.gradle text diff=java
*.gradle.kts text diff=kotlin
*.groovy text diff=java
*.java text diff=java
*.kt text diff=kotlin
*.scala text diff=java

# Python
*.pxd text diff=python
*.py text diff=python
*.py3 text diff=python
*.pyi text diff=python
*.pyw text diff=python
*.pyx text diff=python
*.pyz text diff=python
82 changes: 41 additions & 41 deletions .github/workflows/code-analysis.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
name: Code Analysis

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: 30 0 * * 1

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language:
- python

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
name: Code Analysis

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: 30 0 * * 1

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language:
- python

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
86 changes: 36 additions & 50 deletions .github/workflows/publishing.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,36 @@
name: Publishing

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
pypi:
name: Publish to PyPI
strategy:
fail-fast: false
matrix:
python-version:
- '3.10'
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
#----------------------------------------------
- name: Checkout repository
uses: actions/checkout@v3
#----------------------------------------------
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
#----------------------------------------------
- name: Load cached venv
id: cached-venv
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
#----------------------------------------------
- name: Set PyPI Token
run: poetry config pypi-token.pypi '${{ secrets.PYPI_TOKEN }}'
- name: Publish Project
run: poetry publish --build
name: Publishing

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
pypi:
name: Publish to PyPI
strategy:
fail-fast: false
matrix:
python-version:
- '3.11'
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
#----------------------------------------------
- name: Checkout repository
uses: actions/checkout@v3
#----------------------------------------------
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup environment
run: pip install twine build packaging
#----------------------------------------------
- name: Build project
run: python -m build
- name: Check dist
run: twine check dist/*
- name: Publish project
run: twine upload --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/*
Loading

0 comments on commit eb3cf5d

Please sign in to comment.