-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from Poetry to Hatch
- Loading branch information
Showing
54 changed files
with
518 additions
and
3,404 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: "code quality" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
build: | ||
name: "Static checks and tests" | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Set up pip cache | ||
if: runner.os == 'Linux' | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} | ||
restore-keys: ${{ runner.os }}-pip- | ||
- name: Install hatch | ||
run: | | ||
python -m pip install hatch | ||
- name: Run format and lint check | ||
run: hatch fmt --check | ||
# - name: Run mypy | ||
# run: hatch run mypy src tests | ||
- name: Run Tests | ||
run: hatch run +py=${{ matrix.python-version }} all:cov | ||
- name: Disambiguate coverage filename | ||
run: mv .coverage ".coverage.${{ matrix.os }}.${{ matrix.python-version }}" | ||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-${{ matrix.os }}-${{ matrix.python-version }} | ||
path: .coverage* | ||
- name: Build dist | ||
run: hatch build |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,71 @@ | ||
Hatch - for packaging and publishing https://hatch.pypa.io | ||
# Development instructions | ||
|
||
## Required tools | ||
* Hatch - for packaging and publishing https://hatch.pypa.io | ||
|
||
## Basic hatch commands | ||
|
||
Create (default) environment: | ||
``` | ||
hatch env create | ||
``` | ||
|
||
Activate (default) environment: | ||
``` | ||
hatch shell | ||
``` | ||
|
||
## PyCharm | ||
|
||
When opening 'paita' in PyCharm do the following: | ||
* Right click 'src'-folder and select 'Mark Directory as'->'Sources Root' | ||
* Configure virtualenv: | ||
* `hatch env find default` | ||
* Set Python interpreter based on above path | ||
|
||
## Other hatch commands | ||
|
||
Activate (specific version) environment: | ||
``` | ||
hatch -e all.py3.8 shell | ||
``` | ||
|
||
Run paita application: | ||
``` | ||
python -m paita.tui.app | ||
``` | ||
|
||
Debugging requires textual console on **separate terminal** window/tab: | ||
``` | ||
hatch run textual console | ||
``` | ||
|
||
Run paita application in dev-mode: | ||
``` | ||
hatch run textual run src/paita/tui/app.py --dev | ||
``` | ||
|
||
Run formatter and linter: | ||
``` | ||
hatch fmt | ||
``` | ||
|
||
Run type checker: | ||
``` | ||
mypy src tests | ||
``` | ||
|
||
Run tests for current (default) env | ||
``` | ||
hatch run test | ||
``` | ||
|
||
Run tests for all configured envs | ||
``` | ||
hatch run all:test | ||
``` | ||
|
||
Run test with coverage | ||
``` | ||
hatch run cov | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[mypy] | ||
check_untyped_defs = True | ||
exclude = ^paita/ai/bedrock.py$ | ||
# exclude = ^paita/ai/bedrock.py$ | ||
|
||
[mypy-desert,marshmallow,nox.*,pytest,pytest_mock,_pytest.*] | ||
ignore_missing_imports = True |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.