diff --git a/.github/actions/setup-poetry-env/action.yml b/.github/actions/setup-poetry-env/action.yml new file mode 100644 index 0000000..a7cdeb8 --- /dev/null +++ b/.github/actions/setup-poetry-env/action.yml @@ -0,0 +1,33 @@ +name: "setup-poetry-env" +description: "Composite action to setup the Python and poetry environment." + +inputs: + python-version: + required: false + description: "The python version to use" + default: "3.11" + +runs: + using: "composite" + steps: + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python-version }} + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-in-project: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('poetry.lock') }} + + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction + shell: bash diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..401117e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,74 @@ +name: Main + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - name: Check out + uses: actions/checkout@v3 + + - uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + + - name: Set up the environment + uses: ./.github/actions/setup-poetry-env + + - name: Run checks + run: make check + + tox: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11'] + fail-fast: false + steps: + - name: Check out + uses: actions/checkout@v3 + + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Poetry + uses: snok/install-poetry@v1 + + - name: Load cached venv + uses: actions/cache@v3 + with: + path: .tox + key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} + + - name: Install tox + run: | + python -m pip install --upgrade pip + python -m pip install tox tox-gh-actions + + - name: Test with tox + run: tox + + - name: Upload coverage reports to Codecov with GitHub Action on Python 3.11 + uses: codecov/codecov-action@v3 + if: ${{ matrix.python-version == '3.11' }} + + check-docs: + runs-on: ubuntu-latest + steps: + - name: Check out + uses: actions/checkout@v3 + + - name: Set up the environment + uses: ./.github/actions/setup-poetry-env + + - name: Check if documentation can be built + run: poetry run mkdocs build -s diff --git a/.github/workflows/on-release-main.yml b/.github/workflows/on-release-main.yml new file mode 100644 index 0000000..6a24999 --- /dev/null +++ b/.github/workflows/on-release-main.yml @@ -0,0 +1,44 @@ +name: release-main + +on: + release: + types: [published] + branches: [main] + +jobs: + + publish: + runs-on: ubuntu-latest + steps: + - name: Check out + uses: actions/checkout@v3 + + - name: Set up the environment + uses: ./.github/actions/setup-poetry-env + + - name: Export tag + id: vars + run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT + + - name: Build and publish + run: | + source .venv/bin/activate + poetry version $RELEASE_VERSION + make build-and-publish + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + RELEASE_VERSION: ${{ steps.vars.outputs.tag }} + + deploy-docs: + needs: publish + runs-on: ubuntu-latest + steps: + - name: Check out + uses: actions/checkout@v3 + + - name: Set up the environment + uses: ./.github/actions/setup-poetry-env + + - name: Deploy documentation + run: poetry run mkdocs gh-deploy --force + \ No newline at end of file diff --git a/.github/workflows/validate-codecov-config.yml b/.github/workflows/validate-codecov-config.yml new file mode 100644 index 0000000..d063161 --- /dev/null +++ b/.github/workflows/validate-codecov-config.yml @@ -0,0 +1,15 @@ +name: validate-codecov-config + +on: + pull_request: + paths: [codecov.yaml] + push: + branches: [main] + +jobs: + validate-codecov-config: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Validate codecov configuration + run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d2b8df3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,164 @@ +docs/source + +# From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore + + Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.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 +.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/ \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..65dda4d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: "v0.0.230" + hooks: + - id: ruff + + - repo: https://github.com/psf/black + rev: "22.8.0" + hooks: + - id: black \ No newline at end of file diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 0000000..cec80b0 --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,151 @@ +============ +Contributing +============ + +Contributions are welcome, and they are greatly appreciated! Every little bit +helps, and credit will always be given. + +You can contribute in many ways: + +Types of Contributions +---------------------- + +Report Bugs +~~~~~~~~~~~ + +Report bugs at https://github.com/stringertheory/json-explorer/issues + +If you are reporting a bug, please include: + +* Your operating system name and version. +* Any details about your local setup that might be helpful in troubleshooting. +* Detailed steps to reproduce the bug. + +Fix Bugs +~~~~~~~~ + +Look through the GitHub issues for bugs. Anything tagged with "bug" +and "help wanted" is open to whoever wants to implement a fix for it. + +Implement Features +~~~~~~~~~~~~~~~~~~ + +Look through the GitHub issues for features. Anything tagged with "enhancement" +and "help wanted" is open to whoever wants to implement it. + +Write Documentation +~~~~~~~~~~~~~~~~~~~ + +Cookiecutter PyPackage could always use more documentation, whether as part of +the official docs, in docstrings, or even on the web in blog posts, articles, +and such. + +Submit Feedback +~~~~~~~~~~~~~~~ + +The best way to send feedback is to file an issue at +https://github.com/stringertheory/json-explorer/issues. + +If you are proposing a new feature: + +* Explain in detail how it would work. +* Keep the scope as narrow as possible, to make it easier to implement. +* Remember that this is a volunteer-driven project, and that contributions + are welcome :) + +Get Started! +------------ + +Ready to contribute? Here's how to set up `json-explorer` for local +development. Please note this documentation assumes you already have +`poetry` and `Git` installed and ready to go. + +| 1. Fork the `json-explorer` repo on GitHub. + +| 2. Clone your fork locally: + + .. code-block:: bash + + cd + git clone git@github.com:YOUR_NAME/json-explorer.git + + +| 3. Now we need to install the environment. Navigate into the directory + + .. code-block:: bash + + cd json-explorer + + If you are using ``pyenv``, select a version to use locally. (See installed versions with ``pyenv versions``) + + .. code-block:: bash + + pyenv local + + Then, install and activate the environment with: + + .. code-block:: bash + + poetry install + poetry shell + +| 4. Install pre-commit to run linters/formatters at commit time: + + .. code-block:: bash + + poetry run pre-commit install + +| 5. Create a branch for local development: + + .. code-block:: bash + + git checkout -b name-of-your-bugfix-or-feature + + Now you can make your changes locally. + + +| 6. Don't forget to add test cases for your added functionality to the ``tests`` directory. + +| 7. When you're done making changes, check that your changes pass the formatting tests. + + .. code-block:: bash + + make check + +| 8. Now, validate that all unit tests are passing: + + .. code-block:: bash + + make test + +| 9. Before raising a pull request you should also run tox. This will run the + tests across different versions of Python: + + .. code-block:: bash + + tox + + This requires you to have multiple versions of python installed. + This step is also triggered in the CI/CD pipeline, so you could also choose to skip this + step locally. + +| 10. Commit your changes and push your branch to GitHub: + + .. code-block:: bash + + git add . + git commit -m "Your detailed description of your changes." + git push origin name-of-your-bugfix-or-feature + +| 11. Submit a pull request through the GitHub website. + +Pull Request Guidelines +--------------------------- + +Before you submit a pull request, check that it meets these guidelines: + +1. The pull request should include tests. + +2. If the pull request adds functionality, the docs should be updated. Put your + new functionality into a function with a docstring, and add the feature to + the list in README.rst. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8ef2114 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023, Mike Stringer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d394d72 --- /dev/null +++ b/Makefile @@ -0,0 +1,56 @@ +.PHONY: install +install: ## Install the poetry environment and install the pre-commit hooks + @echo "🚀 Creating virtual environment using pyenv and poetry" + @poetry install + @ poetry run pre-commit install + @poetry shell + +.PHONY: check +check: ## Run code quality tools. + @echo "🚀 Checking Poetry lock file consistency with 'pyproject.toml': Running poetry lock --check" + @poetry lock --check + @echo "🚀 Linting code: Running pre-commit" + @poetry run pre-commit run -a + @echo "🚀 Static type checking: Running mypy" + @poetry run mypy + @echo "🚀 Checking for obsolete dependencies: Running deptry" + @poetry run deptry . + +.PHONY: test +test: ## Test the code with pytest + @echo "🚀 Testing code: Running pytest" + @poetry run pytest --cov --cov-config=pyproject.toml --cov-report=xml + +.PHONY: build +build: clean-build ## Build wheel file using poetry + @echo "🚀 Creating wheel file" + @poetry build + +.PHONY: clean-build +clean-build: ## clean build artifacts + @rm -rf dist + +.PHONY: publish +publish: ## publish a release to pypi. + @echo "🚀 Publishing: Dry run." + @poetry config pypi-token.pypi $(PYPI_TOKEN) + @poetry publish --dry-run + @echo "🚀 Publishing." + @poetry publish + +.PHONY: build-and-publish +build-and-publish: build publish ## Build and publish. + +.PHONY: docs-test +docs-test: ## Test if documentation can be built without warnings or errors + @poetry run mkdocs build -s + +.PHONY: docs +docs: ## Build and serve the documentation + @poetry run mkdocs serve + +.PHONY: help +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' + +.DEFAULT_GOAL := help \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..12b6c13 --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# json-explorer + +[![Release](https://img.shields.io/github/v/release/stringertheory/json-explorer)](https://img.shields.io/github/v/release/stringertheory/json-explorer) +[![Build status](https://img.shields.io/github/actions/workflow/status/stringertheory/json-explorer/main.yml?branch=main)](https://github.com/stringertheory/json-explorer/actions/workflows/main.yml?query=branch%3Amain) +[![codecov](https://codecov.io/gh/stringertheory/json-explorer/branch/main/graph/badge.svg)](https://codecov.io/gh/stringertheory/json-explorer) +[![Commit activity](https://img.shields.io/github/commit-activity/m/stringertheory/json-explorer)](https://img.shields.io/github/commit-activity/m/stringertheory/json-explorer) +[![License](https://img.shields.io/github/license/stringertheory/json-explorer)](https://img.shields.io/github/license/stringertheory/json-explorer) + +Explore the structure of a bunch of jsons + +- **Github repository**: +- **Documentation** + +## Getting started with your project + +First, create a repository on GitHub with the same name as this project, and then run the following commands: + +``` bash +git init -b main +git add . +git commit -m "init commit" +git remote add origin git@github.com:stringertheory/json-explorer.git +git push -u origin main +``` + +Finally, install the environment and the pre-commit hooks with + +```bash +make install +``` + +You are now ready to start development on your project! The CI/CD +pipeline will be triggered when you open a pull request, merge to main, +or when you create a new release. + +To finalize the set-up for publishing to PyPi or Artifactory, see +[here](https://fpgmaas.github.io/cookiecutter-poetry/features/publishing/#set-up-for-pypi). +For activating the automatic documentation with MkDocs, see +[here](https://fpgmaas.github.io/cookiecutter-poetry/features/mkdocs/#enabling-the-documentation-on-github). +To enable the code coverage reports, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/codecov/). + +## Releasing a new version + +- Create an API Token on [Pypi](https://pypi.org/). +- Add the API Token to your projects secrets with the name `PYPI_TOKEN` by visiting +[this page](https://github.com/stringertheory/json-explorer/settings/secrets/actions/new). +- Create a [new release](https://github.com/stringertheory/json-explorer/releases/new) on Github. +Create a new tag in the form ``*.*.*``. + +For more details, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/cicd/#how-to-trigger-a-release). + +--- + +Repository initiated with [fpgmaas/cookiecutter-poetry](https://github.com/fpgmaas/cookiecutter-poetry). \ No newline at end of file diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 0000000..058cfb7 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,9 @@ +coverage: + range: 70..100 + round: down + precision: 1 + status: + project: + default: + target: 90% + threshold: 0.5% diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..29fd20d --- /dev/null +++ b/docs/index.md @@ -0,0 +1,8 @@ +# json-explorer + +[![Release](https://img.shields.io/github/v/release/stringertheory/json-explorer)](https://img.shields.io/github/v/release/stringertheory/json-explorer) +[![Build status](https://img.shields.io/github/actions/workflow/status/stringertheory/json-explorer/main.yml?branch=main)](https://github.com/stringertheory/json-explorer/actions/workflows/main.yml?query=branch%3Amain) +[![Commit activity](https://img.shields.io/github/commit-activity/m/stringertheory/json-explorer)](https://img.shields.io/github/commit-activity/m/stringertheory/json-explorer) +[![License](https://img.shields.io/github/license/stringertheory/json-explorer)](https://img.shields.io/github/license/stringertheory/json-explorer) + +Explore the structure of a bunch of jsons \ No newline at end of file diff --git a/docs/modules.md b/docs/modules.md new file mode 100644 index 0000000..782a8a7 --- /dev/null +++ b/docs/modules.md @@ -0,0 +1 @@ +::: json_explorer \ No newline at end of file diff --git a/json_explorer/__init__.py b/json_explorer/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/json_explorer/foo.py b/json_explorer/foo.py new file mode 100644 index 0000000..35fd0ac --- /dev/null +++ b/json_explorer/foo.py @@ -0,0 +1,17 @@ +def foo() -> str: + """Summary line. + + Extended description of function. + + Args: + foo (str): Description of arg1 + + Returns: + str: Description of return value + """ + + return "foo" + + +if __name__ == "__main__": # pragma: no cover + pass diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..7e74f92 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,54 @@ +site_name: json-explorer +repo_url: https://github.com/stringertheory/json-explorer +site_url: https://stringertheory.github.io/json-explorer +site_description: Explore the structure of a bunch of jsons +site_author: Mike Stringer +edit_uri: edit/main/docs/ +repo_name: stringertheory/json-explorer +copyright: Maintained by Florian. + +nav: + - Home: index.md + - Modules: modules.md +plugins: + - search + - mkdocstrings: + handlers: + python: + setup_commands: + - import sys + - sys.path.append('../') +theme: + name: material + feature: + tabs: true + palette: + - media: "(prefers-color-scheme: light)" + scheme: default + primary: white + accent: deep orange + toggle: + icon: material/brightness-7 + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: black + accent: deep orange + toggle: + icon: material/brightness-4 + name: Switch to light mode + icon: + repo: fontawesome/brands/github + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/stringertheory/json-explorer + - icon: fontawesome/brands/python + link: https://pypi.org/project/json-explorer + +markdown_extensions: + - toc: + permalink: true + - pymdownx.arithmatex: + generic: true \ No newline at end of file diff --git a/poetry.toml b/poetry.toml new file mode 100644 index 0000000..ab1033b --- /dev/null +++ b/poetry.toml @@ -0,0 +1,2 @@ +[virtualenvs] +in-project = true diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f7bb0ce --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,101 @@ +[tool.poetry] +name = "json_explorer" +version = "0.0.1" +description = "Explore the structure of a bunch of jsons" +authors = ["Mike Stringer "] +repository = "https://github.com/stringertheory/json-explorer" +documentation = "https://stringertheory.github.io/json-explorer/" +readme = "README.md" +packages = [ + {include = "json_explorer"} +] + +[tool.poetry.dependencies] +python = ">=3.8,<4.0" + +[tool.poetry.group.dev.dependencies] +pytest = "^7.2.0" +pytest-cov = "^4.0.0" +deptry = "^0.6.4" +mypy = "^0.981" +pre-commit = "^2.20.0" +tox = "^3.25.1" + +[tool.poetry.group.docs.dependencies] +mkdocs = "^1.4.2" +mkdocs-material = "^8.5.10" +mkdocstrings = {extras = ["python"], version = "^0.19.0"} + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.black] +line-length = 120 +target-version = ['py37'] +preview = true + +[tool.mypy] +files = ["json_explorer"] +disallow_untyped_defs = "True" +disallow_any_unimported = "True" +no_implicit_optional = "True" +check_untyped_defs = "True" +warn_return_any = "True" +warn_unused_ignores = "True" +show_error_codes = "True" + +[tool.ruff] +target-version = "py37" +line-length = 120 +fix = true +select = [ + # flake8-2020 + "YTT", + # flake8-bandit + "S", + # flake8-bugbear + "B", + # flake8-builtins + "A", + # flake8-comprehensions + "C4", + # flake8-debugger + "T10", + # flake8-simplify + "SIM", + # isort + "I", + # mccabe + "C90", + # pycodestyle + "E", "W", + # pyflakes + "F", + # pygrep-hooks + "PGH", + # pyupgrade + "UP", + # ruff + "RUF", + # tryceratops + "TRY", +] +ignore = [ + # LineTooLong + "E501", + # DoNotAssignLambda + "E731", +] + +[tool.ruff.per-file-ignores] +"tests/*" = ["S101"] + +[tool.coverage.report] +skip_empty = true + +[tool.coverage.run] +branch = true +source = ["json_explorer"] + + diff --git a/tests/test_foo.py b/tests/test_foo.py new file mode 100644 index 0000000..4eac7ef --- /dev/null +++ b/tests/test_foo.py @@ -0,0 +1,5 @@ +from json_explorer.foo import foo + + +def test_foo(): + assert foo() == "foo" diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..ed3e35c --- /dev/null +++ b/tox.ini @@ -0,0 +1,18 @@ +[tox] +skipsdist = true +envlist = py38, py39, py310, py311 + +[gh-actions] +python = + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + +[testenv] +passenv = PYTHON_VERSION +allowlist_externals = poetry +commands = + poetry install -v + pytest --doctest-modules tests --cov --cov-config=pyproject.toml --cov-report=xml + mypy