From 927c3c179fca99c2c503c7f77d6be0b4e8af8a45 Mon Sep 17 00:00:00 2001 From: Alvin Noe Ladines Date: Tue, 12 Mar 2024 16:32:40 +0100 Subject: [PATCH] Fix nomad dependency --- .github/workflows/python-actions.yaml | 36 +++++++++++++++++++++++---- pyproject.toml | 29 +++++++++++---------- 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/.github/workflows/python-actions.yaml b/.github/workflows/python-actions.yaml index 4f3e7ad..c712ad0 100644 --- a/.github/workflows/python-actions.yaml +++ b/.github/workflows/python-actions.yaml @@ -1,7 +1,7 @@ -name: test +name: install-and-test-workflow on: [push] jobs: - install-test: + install-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -12,7 +12,10 @@ jobs: - name: Install dependencies run: | pip install --upgrade pip - pip install .[tests] + # we need the latest nomad version for testing + pip install nomad-lab[infrastructure]@git+https://github.com/nomad-coe/nomad.git@develop + pip install '.[tests]' --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple + pip install coverage coveralls - name: pycodestyle run: | python -m pycodestyle --ignore=E501,E701,E731 *parsers tests @@ -22,10 +25,33 @@ jobs: - name: mypy run: | python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional *parsers tests + - name: Test with pytest + if: success() || failure() run: | - python -m pytest -sv tests - + python -m coverage run -m pytest -sv tests + - name: Submit to coveralls + continue-on-error: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + coveralls --service=github + build-and-install: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Build the package + run: | + pip install --upgrade pip + pip install build + python -m build --sdist + - name: Install the package + run: | + pip install dist/*.tar.gz --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple ruff: runs-on: ubuntu-latest steps: diff --git a/pyproject.toml b/pyproject.toml index d884a46..08debe3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,14 +3,13 @@ requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] -name = 'databaseparsers' -version = '1.0' -description = 'Collection of NOMAD parsers for databases.' +name = "databaseparsers" +version = "1.0" +description = "Collection of NOMAD parsers for databases." readme = "README.md" authors = [{ name = "The NOMAD Authors" }] license = { file = "LICENSE" } dependencies = [ - "nomad-lab[infrastructure]@git+https://github.com/nomad-coe/nomad.git@develop", "nomad-schema-plugin-simulation-workflow@git+https://github.com/nomad-coe/nomad-schema-plugin-simulation-workflow.git@develop", "nomad-schema-plugin-run@git+https://github.com/nomad-coe/nomad-schema-plugin-run.git@develop" ] @@ -20,16 +19,16 @@ homepage = "https://github.com/nomad-coe/database-parsers" [project.optional-dependencies] tests = [ - 'mypy==1.0.1', - 'pylint==2.13.9', - 'pylint_plugin_utils==0.5', - 'pycodestyle==2.8.0', - 'pytest==3.10.0', - 'pytest-timeout==1.4.2', - 'pytest-cov==2.7.1', - 'astroid==2.11.7', - 'typing-extensions==4.4.0', - 'ruff==0.1.4', + "mypy==1.0.1", + "pylint==2.13.9", + "pylint_plugin_utils==0.5", + "pycodestyle==2.8.0", + "pytest==3.10.0", + "pytest-timeout==1.4.2", + "pytest-cov==2.7.1", + "astroid==2.11.7", + "typing-extensions==4.4.0", + "ruff==0.1.4", ] [tool.ruff] @@ -62,7 +61,7 @@ include = [ ] [tool.setuptools.package-data] -databaseparsers = ['*/metadata.yaml', '*/README.md'] +databaseparsers = ["*/metadata.yaml", "*/README.md"] [tool.mypy] strict = false