Skip to content

Commit

Permalink
Migrate to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
niknetniko committed May 23, 2024
1 parent 106446b commit 06f9cb8
Show file tree
Hide file tree
Showing 9 changed files with 1,218 additions and 905 deletions.
75 changes: 19 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,32 @@ on: [ push ]

jobs:
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11.2
cache: 'pipenv'
- run: pip install pipenv
- run: pipenv install --dev
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: haskell/actions/setup@v2
with:
ghc-version: '9.2'
cabal-version: '3.6'
- uses: actions/cache@v3
name: Cache cabal
with:
path: |
~/.cabal
~/.ghc
dist-newstyle
key: ${{ runner.os }}-ghc-9.2.1-20220111
restore-keys: |
${{ runner.os }}-ghc-9.2.1-
- run: cabal v1-install aeson
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install abstract-syntax-tree@2.20
- run: npm install -g eslint@8.36
- run: sudo apt -y install hlint cppcheck shellcheck checkstyle
- run: curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.48.2/ktlint && chmod a+x ktlint
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main
- run: echo "${GITHUB_WORKSPACE}" >> $GITHUB_PATH
- run: pipenv run pytest -n auto --cov=tested --cov-report=xml tests/
- run: nix develop -c poetry run pytest -n auto --cov=tested --cov-report=xml tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: isort/isort-action@v1.0.0
with:
sortPaths: "./tested ./tests"
- uses: psf/black@stable
with:
version: "~= 23.0"
src: "./tested ./tests"
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main
- run: echo "${GITHUB_WORKSPACE}" >> $GITHUB_PATH
- run: nix develop -c poetry run isort ./tested ./tests
- run: nix develop -c black ./tested ./tests
types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11.2
cache: 'pipenv'
- run: pip install pipenv
- run: pipenv install --dev
- run: echo "$(pipenv --venv)/bin" >> $GITHUB_PATH
- uses: jakebailey/pyright-action@v1
with:
version: '1.1.316'
warnings: true
working-directory: tested/
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main
- run: echo "${GITHUB_WORKSPACE}" >> $GITHUB_PATH
- run: nix develop -c pyright ./tested
30 changes: 0 additions & 30 deletions Pipfile

This file was deleted.

663 changes: 0 additions & 663 deletions Pipfile.lock

This file was deleted.

13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ We only use the Python language module in this README, but see [dependencies.md]

Install [Python 3.11](https://www.python.org/downloads/) or later (including pip).
Next, [clone](https://github.com/git-guides/git-clone) the TESTed repository and open a command prompt in the cloned repository.
TESTed uses [pipenv](https://pipenv.pypa.io/en/latest/installation/) to manage its Python dependencies.
TESTed uses [poetry](https://python-poetry.org/) to manage its Python dependencies.
Now you can run the following commands to install them:

```bash
# Pipenv install
$ pip install pipenv --user
$ pip install poetry --user
# Install dependencies (include --dev for tests/development)
$ pipenv sync --dev
# Activate the virtualenv
$ pipenv shell
$ poetry install
```

Those using [Nix](https://nixos.org/) can use `nix develop` to get a development environment.
`nix run` will run TESTed.

## Running TESTed

TESTed evaluates a submission for a programming exercise based on a test suite that specifies some test cases for the exercise.
Expand Down Expand Up @@ -220,6 +221,8 @@ The repository of TESTed is organized as follows:
- `tested`: Python code of the actual judge (run by Dodona)
- `tests`: unit tests for TESTed



You can run the basic unit tests with:

```bash
Expand Down
2 changes: 1 addition & 1 deletion dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ each language, we list the required dependencies, and their install instructions

See https://github.com/dodona-edu/docker-images/blob/master/dodona-tested.dockerfile

You can also take a look at the `.github/workflows/ci.yml` file, as it will also install most dependencies.
You can also take a look at the `flake.nix` file, as it will also install most dependencies.

## Languages

Expand Down
Loading

0 comments on commit 06f9cb8

Please sign in to comment.