Skip to content

Commit

Permalink
Add some of my typical project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
AstraLuma committed Nov 20, 2024
1 parent 08dfd99 commit c40f73c
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pre-commit

on: [push]

jobs:
lint:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- uses: teahouse-hosting/pre-commit@main
26 changes: 26 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pytest

on: [push]

jobs:
pytest:

runs-on: ubuntu-latest
strategy:
matrix:
# ["pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install Dependencies
run: poetry install
- name: Run tests
run: poetry run pytest --verbose
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: PyPI Publish

on:
release:
types: [published]

permissions:
contents: read

jobs:
ship:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/chaise
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
# - repo: https://github.com/astral-sh/ruff-pre-commit
# # Ruff version.
# rev: v0.4.9
# hooks:
# # Run the linter.
# - id: ruff
# # Run the formatter.
# - id: ruff-format
14 changes: 13 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,17 @@ set windows-powershell := true
@help:
just --list --list-submodules

# Set up dev environments
install:
pre-commit install

# Run the pre-commit hooks
hooks:
pre-commit run --all-files

# Run the tests
test *ARGS:
pytest {{ARGS}}

generate:
make src/steamapi/steamapi.py
make src/steamapi/steamapi.py
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
src/steamapi/steamapi.py: sdk/public/steam/steam_api.json
python3 generate.py $< $@
python3 generate.py $< $@
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ steamapi

Python bindings to access the steam overlay API (overlay, stats, achievements, DLC, etc).

Extracted from Ren'Py.
Extracted from Ren'Py.
1 change: 0 additions & 1 deletion src/steamapi/steamapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15448,4 +15448,3 @@ def get_api_call_result(call, callback_type):
raise APIFailure(call)

return result

2 changes: 2 additions & 0 deletions tests/test_filler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_nothing():
assert True

0 comments on commit c40f73c

Please sign in to comment.