diff --git a/.github/workflows/doc.yaml b/.github/workflows/doc.yaml new file mode 100644 index 0000000..5a02341 --- /dev/null +++ b/.github/workflows/doc.yaml @@ -0,0 +1,26 @@ +name: Docs via GitHub Pages + +on: + push: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: '3.8' + - name: Pip updated + run: | + pip install --upgrade pip + - name: Doc installation + run: | + make install-doc + - name: Documenting + run: | + make doc diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..8a4af0c --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,30 @@ +name: Lint the module + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + # needs: NOTHING + lint: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: '3.8' + - name: Pip updated + run: | + pip install --upgrade pip + - name: Lint installation + run: | + make install-lint + - name: Linting + run: | + make lint diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..60c5022 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,33 @@ +name: Test the module + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + tests: + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11'] + # os: [ubuntu-20.04, ubuntu-22.04] + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install the module and its dependencies + run: | + make install + - name: Show dependencies + run: python -m pip list + - name: Run tests + run: make test-parallel + - name: Publish code coverage + uses: codecov/codecov-action@v3 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7da2c24..0723e34 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,7 +50,7 @@ pages: echo "*********** Pip updated ***********" make install-doc echo "*********** Docs dependencies installed ***********" - mkdocs build + make doc echo "*********** Successfully builded the project documentation ***********" # only: # - main diff --git a/Makefile b/Makefile index 68aa7a1..3f8e938 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ install-test: ## Install only test version of the package pip install .[test] install-lint: - pip install ruff==0.0.193 + pip install black[d]==23.1.0 ruff==0.0.246 install-build: pip install -U build diff --git a/pyproject.toml b/pyproject.toml index b1606e2..a60c090 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "python_template" version = "0.0.0" description = "Python Template" -requires-python = ">=3.8,<3.9" +requires-python = ">=3.8,<3.12" authors = [ {name = "template", email = "template@github.com"}, @@ -28,6 +28,9 @@ classifiers = [ "Operating System :: Unix", "Operating System :: MacOS", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ] dependencies = [ @@ -51,9 +54,9 @@ doc = [ ] dev = [ - "black[d]", - "pre-commit", + "black[d]==23.1.0", "ruff==0.0.246", + "pre-commit", "mypy", "build", ] @@ -173,7 +176,7 @@ combine-as-imports = true # mypy section # Read more here: https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file [tool.mypy] -python_version = "3.8" +# python_version = "3.8" files = ["python_template"] # exclude = ['^tests/'] strict = true