diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 9cd4bb0..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: CI - -on: - push: - branches: - - "**" - pull_request: - branches: - - main - schedule: - - cron: "0 0 * * MON" - workflow_dispatch: - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install dependencies - run: | - python3 -m pip -q install isort mypy pytest ruff yamllint - - name: Run ruff - run: | - python3 -m ruff . - - name: Run isort - run: | - python3 -m isort --check --diff . - - name: Run mypy - run: | - python3 -m mypy . - - name: Run yamllint - run: | - python3 -m yamllint -d "{ignore: turing, extends: default, rules: {document-start: {present: false}, line-length: disable, truthy: {check-keys: false}}}" . - - test: - runs-on: ubuntu-latest - defaults: - run: - working-directory: docker - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Create volume - run: bash docker_create_volume.sh - - name: Create container - run: bash docker_create_container.sh - - name: Create database - run: bash docker_create_database.sh - - name: Start container - run: bash docker_start.sh - - name: Run tests - run: bash docker_run_tests.sh - - name: Stop container - run: bash docker_stop.sh - - name: Destroy container - run: bash docker_destroy_container.sh - - warn: - runs-on: ubuntu-latest - if: github.repository == 'dmf-unicatt/turing-docker' && github.ref == 'refs/heads/main' && github.event_name == 'schedule' - steps: - - name: Warn if scheduled workflow is about to be disabled - uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main - with: - workflow-filename: ci.yml - days-elapsed: 50 diff --git a/.github/workflows/mathrace_interaction_ci.yml b/.github/workflows/mathrace_interaction_ci.yml new file mode 100644 index 0000000..561b599 --- /dev/null +++ b/.github/workflows/mathrace_interaction_ci.yml @@ -0,0 +1,74 @@ +name: mathrace-interaction CI + +on: + push: + branches: + - "**" + pull_request: + branches: + - main + schedule: + - cron: "0 0 * * MON" + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + container: debian:12 + defaults: + run: + working-directory: mathrace_interaction + steps: + - name: Install git + run: | + export DEBIAN_FRONTEND="noninteractive" + apt update -y -q + apt install -y -qq git + working-directory: . + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install non-pip dependencies of the community projects scripts library + run: | + export DEBIAN_FRONTEND="noninteractive" + apt install -y -qq python3-pip + rm /usr/lib/python3.*/EXTERNALLY-MANAGED + - name: Install the mathrace-interaction library + run: | + python3 -m pip install .[docs,lint,tests] + - name: Clean build files + run: | + git config --global --add safe.directory $PWD + git clean -xdf + working-directory: . + - name: Run ruff + run: | + python3 -m ruff . + - name: Run isort + run: | + python3 -m isort --check --diff . + - name: Run mypy + run: | + python3 -m mypy . + - name: Run yamllint + run: | + python3 -m yamllint -d "{ignore: turing, extends: default, rules: {document-start: {present: false}, line-length: disable, truthy: {check-keys: false}}}" ../.github + - name: Run documentation generation + run: | + cd docs && python3 -m sphinx -W -b html . build/html + - name: Run tests + run: | + python3 -m coverage run --source=mathrace_interaction -m pytest -svv tests/unit + - name: Check test coverage + run: | + python3 -m coverage report --fail-under=100 --show-missing --skip-covered + + warn: + runs-on: ubuntu-latest + if: github.repository == 'dmf-unicatt/turing-dmf' && github.ref == 'refs/heads/main' && github.event_name == 'schedule' + steps: + - name: Warn if scheduled workflow is about to be disabled + uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main + with: + workflow-filename: mathrace_interaction_ci.yml + days-elapsed: 50 diff --git a/mathrace_interaction/.gitignore b/mathrace_interaction/.gitignore new file mode 100644 index 0000000..e1db900 --- /dev/null +++ b/mathrace_interaction/.gitignore @@ -0,0 +1,10 @@ +*~ +*.bak +*.cache +*.egg +*.egg-info +*.py[cod] +.coverage +.pytest_cache +build +dist diff --git a/mathrace_interaction/pyproject.toml b/mathrace_interaction/pyproject.toml index 8a60d1f..1acb0b1 100644 --- a/mathrace_interaction/pyproject.toml +++ b/mathrace_interaction/pyproject.toml @@ -12,7 +12,7 @@ maintainers = [ {name = "Francesco Ballarin", email = "francesco.ballarin@unicatt.it"}, ] description = "Interfacing mathrace and turing" -license = {file = "../LICENSE"} +license = {text = "GNU Affero General Public License v3 or later (AGPLv3+)"} requires-python = ">=3.10" classifiers = [ "Development Status :: 3 - Alpha", @@ -32,9 +32,9 @@ classifiers = [ dependencies = [] [project.urls] -homepage = "https://github.com/dmf-unicatt/turing-docker" -repository = "https://github.com/dmf-unicatt/turing-docker" -issues = "https://github.com/dmf-unicatt/turing-docker/issues" +homepage = "https://github.com/dmf-unicatt/turing-dmf" +repository = "https://github.com/dmf-unicatt/turing-dmf" +issues = "https://github.com/dmf-unicatt/turing-dmf/issues" funding = "https://github.com/sponsors/francesco-ballarin" [project.optional-dependencies] @@ -47,7 +47,7 @@ lint = [ "ruff", "yamllint" ] -unit_tests = [ +tests = [ "coverage[toml]", "pytest" ] @@ -83,3 +83,6 @@ max-doc-length = 120 [tool.ruff.lint.pydocstyle] convention = "numpy" + +[tool.setuptools.packages.find] +namespaces = false