Skip to content

Commit

Permalink
[PACKAGE-1] Package to PIP (#84)
Browse files Browse the repository at this point in the history
* chore: port changes from test-1

* feat: project rename

* chore: clean up deps

* feat: build with hatchling, build and upload dist using twine

* feat: move deps to src

* feat: add entry point

* feat: add deps to pyproject.toml and resolve path shenanigans

* feat: add deps to pyproject.toml and resolve path shenanigans

* chore: change color of project name in version callback

* docs: update README

* docs: add basic usage

* docs: add advanced usage

* feat: rename PERSONAL_ACCESS_TOKEN to just TOKEN

* docs: add short -h command on setup and dump

* docs: update alt text of icon

* chore: revert version to 0.0.1

* feat: add dynamic versioning

* docs: update basic usage

* chore: move build-system up

* feat: add bandit to ruff config

* chore: reformat

* chore: reformat

* feat: add pre-commit prettier

* feat: add ruff config flake8-builtins

* feat: add ruff config flake8-builtins

* feat: add more ruff rules and add HTTPError request exception handling

* feat (pre-commit): deprecate black in favor of ruff format

* chore: remove unecessary main function

* ci (lint): deprecate black in favor of ruff
  • Loading branch information
seyLu authored Mar 29, 2024
1 parent fd25d73 commit c637519
Show file tree
Hide file tree
Showing 33 changed files with 454 additions and 322 deletions.
33 changes: 5 additions & 28 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,38 +1,15 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
trim_trailing_whitespace = true
charset = utf-8

# 2 space indentation
[*.json, *.html]
indent_style = space
indent_size = 2

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2
[!**/labels]
insert_final_newline = true
max_line_length = 88

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
[*.{yaml,yml,json,toml}]
indent_size = 2
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
GITHUB_PERSONAL_ACCESS_TOKEN=<your_github_personal_access_token>
GITHUB_TOKEN=<your_github_personal_access_token>
GITHUB_REPO_OWNER=<target_github_repository_owner>
GITHUB_REPO_NAME=<target_github_repository_name>
6 changes: 3 additions & 3 deletions .github/workflows/auto-update-pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ run-name: Updating Pre-commit Configuration on ${{ github.repository }}

on:
schedule:
- cron: '0 0 * * 0' # Run every Sunday at midnight UTC
- cron: "0 0 * * 0" # Run every Sunday at midnight UTC
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
description: "Log level"
required: true
default: 'warning'
default: "warning"

jobs:
auto_update:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: ["main"]

jobs:
analyze:
Expand All @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
language: ["python"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
Expand All @@ -60,7 +60,6 @@ jobs:
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.11", "3.12"]

steps:
- name: Harden Runner
Expand All @@ -25,7 +25,7 @@ jobs:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.3
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v3.5.3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v4.7.0
Expand All @@ -40,19 +40,17 @@ jobs:
run: >
pip install
ruff
black
mypy
- name: Ruff Linter
run: ruff check . --diff

- name: Black Formatter
run: black . --diff --check
- name: Ruff Formatter
run: ruff format .

- name: Mypy Type Checker
run: >
mypy .
--install-types
--non-interactive
--check-untyped-defs
--ignore-missing-imports
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/
18 changes: 13 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-merge-conflict
- id: debug-statements
- id: fix-byte-order-marker

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [yaml, toml, markdown]
additional_dependencies:
- prettier@3.0.0
- prettier-plugin-toml@1.0.1

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
- id: ruff-format
Loading

0 comments on commit c637519

Please sign in to comment.