From 88b04206bbf1fa6ce1969ca651f6468554094c69 Mon Sep 17 00:00:00 2001 From: daquintero Date: Thu, 11 Jan 2024 12:00:58 +0100 Subject: [PATCH 1/8] FEAT: Initial migration to the present :runner: --- .idea/.gitignore | 8 +++ .../inspectionProfiles/profiles_settings.xml | 6 +++ .idea/misc.xml | 7 +++ .idea/modules.xml | 8 +++ .idea/sphinxcontrib-cookiecutter.iml | 8 +++ .idea/vcs.xml | 6 +++ cookiecutter.json | 4 +- {{cookiecutter.project_name}}/.travis.yml | 8 +-- {{cookiecutter.project_name}}/pyproject.toml | 54 +++++++++++++++++++ .../requirements.txt | 1 - {{cookiecutter.project_name}}/setup.cfg | 45 ---------------- {{cookiecutter.project_name}}/setup.py | 9 ---- .../test-requirements.txt | 2 - 13 files changed, 104 insertions(+), 62 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/sphinxcontrib-cookiecutter.iml create mode 100644 .idea/vcs.xml create mode 100644 {{cookiecutter.project_name}}/pyproject.toml delete mode 100644 {{cookiecutter.project_name}}/requirements.txt delete mode 100644 {{cookiecutter.project_name}}/setup.cfg delete mode 100644 {{cookiecutter.project_name}}/setup.py delete mode 100644 {{cookiecutter.project_name}}/test-requirements.txt diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..9de2865 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..14387a7 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/sphinxcontrib-cookiecutter.iml b/.idea/sphinxcontrib-cookiecutter.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/sphinxcontrib-cookiecutter.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/cookiecutter.json b/cookiecutter.json index 3dd12c3..976c375 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -4,5 +4,7 @@ "project_name": "sphinxcontrib-{{ cookiecutter.package_name}}", "short_description": "A short description of the extension", "author_name": "Your name", - "author_email": "Your email" + "author_email": "Your email", + "home_page": "http://www.sphinx-doc.org/", + "version": "0.0.1" } diff --git a/{{cookiecutter.project_name}}/.travis.yml b/{{cookiecutter.project_name}}/.travis.yml index ed8810e..9905a5d 100644 --- a/{{cookiecutter.project_name}}/.travis.yml +++ b/{{cookiecutter.project_name}}/.travis.yml @@ -2,10 +2,10 @@ language: python sudo: false cache: pip python: -- 2.7 -- 3.4 -- 3.5 -- 3.6 +- 3.9 +- 3.10 +- 3.11 +- 3.12 - pypy install: - pip install tox-travis diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml new file mode 100644 index 0000000..3588505 --- /dev/null +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -0,0 +1,54 @@ +[tool.poetry] +name = "{{ cookiecutter.project_name }}" +version = "{{cookiecutter.version}}" +description = "{{ cookiecutter.short_description }}" +authors = ["{{ cookiecutter.author_name }} <{{ cookiecutter.author_email }}>"] +homepage = "{{ cookiecutter.home_page }}" +license = "BSD" # Replace with your project's license, if different +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Environment :: Web Environment", + "Framework :: Sphinx :: Extension", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Documentation", + "Topic :: Documentation :: Sphinx", + "Topic :: Utilities" +] + + +[tool.poetry.dependencies] +python = "^3.6" +pbr = "^5.5.1" + +[tool.poetry.dev-dependencies] +pytest = "*" +sphinx = "*" +mypy = "*" +flake8 = "*" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.mypy] +python_version = "3.8" +show_column_numbers = true +show_error_context = true +ignore_missing_imports = true +follow_imports = "skip" +incremental = true +check_untyped_defs = true +warn_unused_ignores = true + +[tool.flake8] +show-source = true +builtins = "unicode" diff --git a/{{cookiecutter.project_name}}/requirements.txt b/{{cookiecutter.project_name}}/requirements.txt deleted file mode 100644 index 1d45dc6..0000000 --- a/{{cookiecutter.project_name}}/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pbr diff --git a/{{cookiecutter.project_name}}/setup.cfg b/{{cookiecutter.project_name}}/setup.cfg deleted file mode 100644 index 96d00f1..0000000 --- a/{{cookiecutter.project_name}}/setup.cfg +++ /dev/null @@ -1,45 +0,0 @@ -[metadata] -name = {{ cookiecutter.project_name }} -summary = {{ cookiecutter.short_description }} -description-file = - README.rst -author = {{ cookiecutter.author_name }} -author-email = {{ cookiecutter.author_email }} -home-page = http://www.sphinx-doc.org/ -classifier = - Development Status :: 3 - Alpha - Environment :: Console - Environment :: Web Environment - Framework :: Sphinx :: Extension - Intended Audience :: Developers - License :: OSI Approved :: BSD License - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Topic :: Documentation - Topic :: Documentation :: Sphinx - Topic :: Utilities - -[files] -packages = - sphinxcontrib -namespace_packages = - sphinxcontrib - -[mypy] -python_version = 3.8 -show_column_numbers = True -show_error_context = True -ignore_missing_imports = True -follow_imports = skip -incremental = True -check_untyped_defs = True -warn_unused_ignores = True - -[flake8] -show-source = True -builtins = unicode diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py deleted file mode 100644 index f7fce87..0000000 --- a/{{cookiecutter.project_name}}/setup.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python - -import setuptools - - -setuptools.setup( - setup_requires=['pbr'], - pbr=True, -) diff --git a/{{cookiecutter.project_name}}/test-requirements.txt b/{{cookiecutter.project_name}}/test-requirements.txt deleted file mode 100644 index 55ff9de..0000000 --- a/{{cookiecutter.project_name}}/test-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest -sphinx From ca1a75a78691a490d673f439597fd6263830bb78 Mon Sep 17 00:00:00 2001 From: daquintero Date: Thu, 11 Jan 2024 12:11:07 +0100 Subject: [PATCH 2/8] FEAT: Update .gitignore too --- .gitignore | 161 ++++++++++++++++-- .idea/.gitignore | 8 - .../inspectionProfiles/profiles_settings.xml | 6 - .idea/misc.xml | 7 - .idea/modules.xml | 8 - .idea/sphinxcontrib-cookiecutter.iml | 8 - .idea/vcs.xml | 6 - 7 files changed, 145 insertions(+), 59 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/sphinxcontrib-cookiecutter.iml delete mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index 46e25ec..788ef56 100644 --- a/.gitignore +++ b/.gitignore @@ -1,34 +1,163 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ *.py[cod] +*$py.class # C extensions *.so -# Packages -*.egg -*.egg-info -dist -build -.eggs -eggs -parts -bin -var -sdist -develop-eggs +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ .installed.cfg -lib -lib64 +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec # Installer logs pip-log.txt +pip-delete-this-directory.txt # Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ .coverage -.tox -.venv +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ # Translations *.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +.idea/ # Complexity output/*.html diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 9de2865..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 14387a7..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/sphinxcontrib-cookiecutter.iml b/.idea/sphinxcontrib-cookiecutter.iml deleted file mode 100644 index d0876a7..0000000 --- a/.idea/sphinxcontrib-cookiecutter.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 20f7058d8f799d3df8cf6ef18e99bf2f954293b5 Mon Sep 17 00:00:00 2001 From: daquintero Date: Thu, 11 Jan 2024 12:27:56 +0100 Subject: [PATCH 3/8] FEAT: Migrate to a README github can see --- {{cookiecutter.project_name}}/README.md | 13 +++++++++++++ {{cookiecutter.project_name}}/README.rst | 19 ------------------- 2 files changed, 13 insertions(+), 19 deletions(-) create mode 100644 {{cookiecutter.project_name}}/README.md delete mode 100644 {{cookiecutter.project_name}}/README.rst diff --git a/{{cookiecutter.project_name}}/README.md b/{{cookiecutter.project_name}}/README.md new file mode 100644 index 0000000..d45c0da --- /dev/null +++ b/{{cookiecutter.project_name}}/README.md @@ -0,0 +1,13 @@ +# {{ cookiecutter.project_name }} + +{{ cookiecutter.short_description}} + +## Overview + + +Add a longer description here. + +## Links + +- Source: +- Bugs: diff --git a/{{cookiecutter.project_name}}/README.rst b/{{cookiecutter.project_name}}/README.rst deleted file mode 100644 index 15f8793..0000000 --- a/{{cookiecutter.project_name}}/README.rst +++ /dev/null @@ -1,19 +0,0 @@ -{{ '=' * cookiecutter.project_name|length }} -{{ cookiecutter.project_name }} -{{ '=' * cookiecutter.project_name|length }} - -.. image:: https://travis-ci.org/{{ cookiecutter.github_org }}/{{ cookiecutter.project_name }}.svg?branch=master - :target: https://travis-ci.org/{{ cookiecutter.github_org }}/{{ cookiecutter.project_name }} - -{{ cookiecutter.short_description}} - -Overview --------- - -Add a longer description here. - -Links ------ - -- Source: https://github.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_name }} -- Bugs: https://github.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_name }}/issues From c86275d36dc4a86b9f7859dbe5adcb43da7bd2f0 Mon Sep 17 00:00:00 2001 From: daquintero Date: Thu, 11 Jan 2024 12:44:58 +0100 Subject: [PATCH 4/8] FEAT: Migrate to github actions --- .../.github/workflows/ci.yaml | 35 +++++++++++++++++++ {{cookiecutter.project_name}}/.travis.yml | 13 ------- {{cookiecutter.project_name}}/README.md | 1 - {{cookiecutter.project_name}}/tox.ini | 32 ----------------- 4 files changed, 35 insertions(+), 46 deletions(-) create mode 100644 {{cookiecutter.project_name}}/.github/workflows/ci.yaml delete mode 100644 {{cookiecutter.project_name}}/.travis.yml delete mode 100644 {{cookiecutter.project_name}}/tox.ini diff --git a/{{cookiecutter.project_name}}/.github/workflows/ci.yaml b/{{cookiecutter.project_name}}/.github/workflows/ci.yaml new file mode 100644 index 0000000..f0d8294 --- /dev/null +++ b/{{cookiecutter.project_name}}/.github/workflows/ci.yaml @@ -0,0 +1,35 @@ +name: Python CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8, 3.9, 3.10, 3.11, 3.12] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install -r test-requirements.txt + pip install pytest mypy flake8 isort yapf + + - name: Run tests with pytest + run: pytest + + - name: Run type checks with mypy + run: mypy sphinxcontrib + + - name: Run style checks + run: | + isort --check-only --diff sphinxcontrib tests + yapf --diff sphinxcontrib tests + flake8 sphinxcontrib tests diff --git a/{{cookiecutter.project_name}}/.travis.yml b/{{cookiecutter.project_name}}/.travis.yml deleted file mode 100644 index 9905a5d..0000000 --- a/{{cookiecutter.project_name}}/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: python -sudo: false -cache: pip -python: -- 3.9 -- 3.10 -- 3.11 -- 3.12 -- pypy -install: -- pip install tox-travis -script: -- tox diff --git a/{{cookiecutter.project_name}}/README.md b/{{cookiecutter.project_name}}/README.md index d45c0da..0f4059a 100644 --- a/{{cookiecutter.project_name}}/README.md +++ b/{{cookiecutter.project_name}}/README.md @@ -4,7 +4,6 @@ ## Overview - Add a longer description here. ## Links diff --git a/{{cookiecutter.project_name}}/tox.ini b/{{cookiecutter.project_name}}/tox.ini deleted file mode 100644 index 5acb1a6..0000000 --- a/{{cookiecutter.project_name}}/tox.ini +++ /dev/null @@ -1,32 +0,0 @@ -[tox] -minversion = 2.0 -envlist = py{34,35,36,py},style - -[testenv] -deps = -r{toxinidir}/test-requirements.txt -commands= - pytest - -[testenv:mypy] -description = - Run type checks. -deps = - mypy -commands= - mypy sphinxcontrib - -[testenv:style] -description = - Run style checks. -deps = - flake8 - isort - yapf -commands = - isort -rc -c -df sphinxcontrib tests - yapf -rd sphinxcontrib tests - flake8 sphinxcontrib tests setup.py - -[travis] -python = - 3.6: py36, mypy, style From 8a02a5a124b4302e41c8cc4b346e252cba407c1e Mon Sep 17 00:00:00 2001 From: daquintero Date: Thu, 11 Jan 2024 12:52:20 +0100 Subject: [PATCH 5/8] FEAT: Add .precommit --- .../.pre-commit-config.yaml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 {{cookiecutter.project_name}}/.pre-commit-config.yaml diff --git a/{{cookiecutter.project_name}}/.pre-commit-config.yaml b/{{cookiecutter.project_name}}/.pre-commit-config.yaml new file mode 100644 index 0000000..a22f307 --- /dev/null +++ b/{{cookiecutter.project_name}}/.pre-commit-config.yaml @@ -0,0 +1,27 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 # Use the latest version from the pre-commit-hooks repository + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + + - repo: https://github.com/pycqa/flake8 + rev: 4.0.1 # Use the latest version of flake8 + hooks: + - id: flake8 + + - repo: https://github.com/pre-commit/mirrors-isort + rev: v5.10.1 # Use the latest version of isort + hooks: + - id: isort + + - repo: https://github.com/asottile/black + rev: 22.3.0 # Use the latest version of black + hooks: + - id: black + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.931 # Use the latest version of mypy + hooks: + - id: mypy From a26c2c927f289d18e3ea64cfcdd1088328f06596 Mon Sep 17 00:00:00 2001 From: daquintero Date: Thu, 11 Jan 2024 13:06:14 +0100 Subject: [PATCH 6/8] FIX: cookiecutter json --- cookiecutter.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 976c375..f07e52f 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -6,5 +6,8 @@ "author_name": "Your name", "author_email": "Your email", "home_page": "http://www.sphinx-doc.org/", - "version": "0.0.1" + "version": "0.0.1", + "_copy_without_render": [ + "*.yaml" + ] } From add0f1905181de4cc2cd6ff8d4963b2552db4b6f Mon Sep 17 00:00:00 2001 From: daquintero Date: Thu, 11 Jan 2024 13:19:57 +0100 Subject: [PATCH 7/8] FIX: pyproject.toml installation extras on ci --- .../.github/workflows/ci.yaml | 3 +-- {{cookiecutter.project_name}}/pyproject.toml | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/ci.yaml b/{{cookiecutter.project_name}}/.github/workflows/ci.yaml index f0d8294..c411450 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/ci.yaml +++ b/{{cookiecutter.project_name}}/.github/workflows/ci.yaml @@ -19,8 +19,7 @@ jobs: - name: Install dependencies run: | - pip install -r test-requirements.txt - pip install pytest mypy flake8 isort yapf + pip install -e .[develop] - name: Run tests with pytest run: pytest diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 3588505..830fbe5 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -29,11 +29,18 @@ classifiers = [ python = "^3.6" pbr = "^5.5.1" -[tool.poetry.dev-dependencies] -pytest = "*" -sphinx = "*" -mypy = "*" -flake8 = "*" +pytest = {version="*", optional=true} +sphinx = {version="*", optional=true} +mypy = {version="*", optional=true} +flake8 ={version="*", optional=true} + +[tool.poetry.extras] +develop = [ + "pytest", + "sphinx", + "mypy", + "flake8" +] [build-system] requires = ["poetry-core>=1.0.0"] From bbabc50d3d6d07231ac0ae1d032a075781f679e3 Mon Sep 17 00:00:00 2001 From: daquintero Date: Thu, 11 Jan 2024 13:29:15 +0100 Subject: [PATCH 8/8] FIX: ci --- .../.github/workflows/ci.yaml | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/ci.yaml b/{{cookiecutter.project_name}}/.github/workflows/ci.yaml index c411450..caef34e 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/ci.yaml +++ b/{{cookiecutter.project_name}}/.github/workflows/ci.yaml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, 3.10, 3.11, 3.12] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 @@ -16,19 +16,39 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - + #---------------------------------------------- + # ----- install & configure poetry ----- + #---------------------------------------------- + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.6.1 + virtualenvs-create: true + virtualenvs-in-project: true + #---------------------------------------------- + # load cached venv if cache exists + #---------------------------------------------- + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + #---------------------------------------------- + # install dependencies if cache does not exist + #---------------------------------------------- - name: Install dependencies - run: | - pip install -e .[develop] + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root -E develop - name: Run tests with pytest - run: pytest + run: poetry run pytest - name: Run type checks with mypy - run: mypy sphinxcontrib + run: poetry run mypy sphinxcontrib - name: Run style checks run: | - isort --check-only --diff sphinxcontrib tests - yapf --diff sphinxcontrib tests - flake8 sphinxcontrib tests + poetry run isort --check-only --diff sphinxcontrib tests + poetry run yapf --diff sphinxcontrib tests + poetry run flake8 sphinxcontrib tests