Skip to content

Commit

Permalink
feat: migrate project to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycojoker committed Jul 9, 2024
1 parent 692cb1c commit 89c51bd
Show file tree
Hide file tree
Showing 7 changed files with 325 additions and 295 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nix-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
nix_path: nixpkgs=channel:${{ matrix.os == 'macos-latest' && 'nixpkgs-23.11-darwin' || 'nixos-23.11' }}

- name: Run tests
run: nix-shell --run "pytest"
run: nix-shell --run "hatch run testing:test"
20 changes: 13 additions & 7 deletions .github/workflows/pyaleph-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ jobs:
with:
# Fetch the whole history for all tags and branches (required for aleph.__version__)
fetch-depth: 0

- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install latest Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -49,33 +51,37 @@ jobs:
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: "install hatch"
run: |
python3 -m venv /tmp/venv
/tmp/venv/bin/python -m pip install --upgrade pip hatch coverage
- uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles('setup.cfg') }}

- name: Install Python dependencies
run: |
rustup default nightly # Required to build some dependencies
pip install wheel
pip install --upgrade .[testing]
- name: Check types
run: |
mypy src/
- name: Check types in tests
run: |
mypy tests/
- name: Run unit tests
run: |
sudo cp .github/openssl-ci.cnf /etc/ssl/openssl.cnf
export OPENSSL_CONF=/etc/ssl/openssl.cnf
touch config.yml # Fake config file for alembic
# TODO: determine why ResourceWarning warnings occur in some tests.
pytest -Werror -Wignore::ResourceWarning -v --cov .
hatch run testing:cov
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: aleph-im/pyaleph

build:
runs-on: ubuntu-22.04
needs: tests
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ This will provide you with a shell with PostgreSQL, Redis, and IPFS running.
To run test you can run:

```bash
nix-shell --run "pytest"
nix-shell --run "hatch run testing:test"
```

Or you can run the command in the nix shell:
```bash
nix-shell

# inside of nix shell
pytest
hatch run testing:test
```

## Software used
Expand Down
72 changes: 0 additions & 72 deletions mypy.ini

This file was deleted.

Loading

0 comments on commit 89c51bd

Please sign in to comment.