From 199e82ddc0b19c4b2a04dab8d91e69ced52c2fe7 Mon Sep 17 00:00:00 2001 From: JulianFP Date: Sat, 25 Nov 2023 13:03:01 +0100 Subject: [PATCH] Initial Commit --- .github/dependabot.yml | 6 ++ .github/workflows/ci.yml | 72 +++++++++++++++++++ .github/workflows/pypi.yml | 29 ++++++++ .gitignore | 141 +++++++++++++++++++++++++++++++++++++ .readthedocs.yml | 16 +++++ COPYING.md | 6 ++ FILESTRUCTURE.md | 44 ++++++++++++ LICENSE.md | 11 +++ README.md | 35 +++++++++ TODO.md | 15 ++++ codecov.yml | 10 +++ doc/Makefile | 20 ++++++ doc/api.rst | 9 +++ doc/conf.py | 45 ++++++++++++ doc/demo.nblink | 3 + doc/index.rst | 17 +++++ doc/intro.rst | 1 + doc/make.bat | 35 +++++++++ notebooks/demo.ipynb | 57 +++++++++++++++ project_W/__init__.py | 11 +++ project_W/__main__.py | 10 +++ pyproject.toml | 73 +++++++++++++++++++ setup.py | 4 ++ tests/__init__.py | 0 tests/conftest.py | 0 tests/test_cli.py | 9 +++ tests/test_project_W.py | 5 ++ 27 files changed, 684 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/pypi.yml create mode 100644 .gitignore create mode 100644 .readthedocs.yml create mode 100644 COPYING.md create mode 100644 FILESTRUCTURE.md create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 TODO.md create mode 100644 codecov.yml create mode 100644 doc/Makefile create mode 100644 doc/api.rst create mode 100644 doc/conf.py create mode 100644 doc/demo.nblink create mode 100644 doc/index.rst create mode 100644 doc/intro.rst create mode 100644 doc/make.bat create mode 100644 notebooks/demo.ipynb create mode 100644 project_W/__init__.py create mode 100644 project_W/__main__.py create mode 100644 pyproject.toml create mode 100644 setup.py create mode 100644 tests/__init__.py create mode 100644 tests/conftest.py create mode 100644 tests/test_cli.py create mode 100644 tests/test_project_W.py diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8ac6b8c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..103ecfd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: CI + +on: + # We run CI on pushes to the main branch + push: + branches: + - main + # and on all pull requests to the main branch + pull_request: + branches: + - main + # as well as upon manual triggers through the 'Actions' tab of the Github UI + workflow_dispatch: + +jobs: + build-and-test: + name: Testing on ${{matrix.os}} + runs-on: ${{matrix.os}} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + # Here, we are testing the oldest and the newest supported Python version. + # If this is insufficient for your package, consider adding more versions. + python-version: ["3.8", "3.12"] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + # setuptools_scm requires a non-shallow clone of the repository + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Python package + run: | + python -m pip install .[tests] + + - name: Run Python tests + run: | + python -m pytest --nbval + + coverage: + name: Coverage Testing + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: "3.8" + + - name: Install Python package + run: | + python -m pip install .[tests] + + - name: Run Python tests + working-directory: ./tests + run: | + python -m pytest --cov --cov-report=xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + files: ./tests/coverage.xml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..7305d6c --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,29 @@ +name: PyPI deploy + +on: + release: + types: + - published + workflow_dispatch: + +jobs: + pypi-deploy: + name: Deploying Python Package + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + # setuptools_scm requires a non-shallow clone of the repository + fetch-depth: 0 + + - uses: actions/setup-python@v4 + name: Install Python + + - name: Build SDist + run: pipx run build --sdist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7e2abf --- /dev/null +++ b/.gitignore @@ -0,0 +1,141 @@ +# Ignore setuptools_scm generated version file +project_W/_version.py + +# 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 + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__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/ diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..190aa1c --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,16 @@ +version: 2 + +build: + os: ubuntu-20.04 + tools: + python: "3.9" + +sphinx: + configuration: doc/conf.py + +formats: all + +python: + install: + - method: pip + path: .[docs] diff --git a/COPYING.md b/COPYING.md new file mode 100644 index 0000000..2fb30d0 --- /dev/null +++ b/COPYING.md @@ -0,0 +1,6 @@ +This is the list of copyright holders of project W. + +For information on the license, see LICENSE.md. + + +* Julian Partanen, 2023 diff --git a/FILESTRUCTURE.md b/FILESTRUCTURE.md new file mode 100644 index 0000000..ebd794d --- /dev/null +++ b/FILESTRUCTURE.md @@ -0,0 +1,44 @@ +This is an explanation of the file structure that the cookiecutter generated for you: + +* Python source files: + * The Python package source files are located in the `project_W` directory. + * The file `project_W.__main__.py` defines a command line interface that + is accessible both as the command `project_W` and via + `python -m project_W`. + * `tests/test_cli.py` contains rudimentary testing of this CLI. + * `tests/test_project_W.py` contains the unit tests for the package. + * `tests/conftest.py` contains testing setup and configuration for `pytest` + * The `notebooks` directory contains an example Jupyter notebook on how to use `project_W`. + This notebook is always executed during `pytest` execution and it is automatically + rendered into the Sphinx documentation. +* Markdown files with meta information on the project. [Markdown](https://www.markdownguide.org/basic-syntax/) is + a good language for these files, as it is easy to write and rendered into something beautiful by your git repository + hosting provider. + * `README.md` is the file that users will typically see first when discovering your project. + * `COPYING.md` provides a list of copyright holders. + * `LICENSE.md` contains the license you selected. + * `TODO.md` contains a list of TODOs after running the cookiecutter. Following the + instructions in that file will give you a fully functional repository with a lot + of integration into useful web services activated and running. + * `FILESTRUCTURE.md` describes the generated files. Feel free to remove this from the + repository if you do not need it. +* Python build system files + * `pyproject.toml` is the central place for configuration of your Python package. + It contains the project metadata, setuptools-specific information and the configuration + for your toolchain (like e.g. `pytest`). + * `setup.py` is still required for editable builds, but you should not need to change it. + In the future, `setuptools` will support editable builds purely from `pyproject.toml` + configuration. +* Configuration for CI/Code Analysis and documentation services + * `.github/workflows/ci.yml` describes the Github Workflow for Continuous + integration. For further reading on workflow files, we recommend the + [introduction into Github Actions](https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/introduction-to-github-actions) + and [the reference of available options](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions). + * `.github/dependabot.yml` configures the DependaBot integration on GitHub that + allows you to automatically create pull requests for updates of the used actions + in `.github/workflows/ci.yml`. + * `.gitlab-ci.yml` describes the configuration for Gitlab CI. For further + reading, we recommend [Gitlabs quick start guide](https://docs.gitlab.com/ee/ci/quick_start/) + and the [Gitlab CI configuration reference](https://docs.gitlab.com/ce/ci/yaml/) + * `.readthedocs.yml` configures the documentation build process at [ReadTheDocs](https://readthedocs.org). + To customize your build, you can have a look at the [available options](https://docs.readthedocs.io/en/stable/config-file/v2.html). diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..64ad508 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,11 @@ +Copyright 2023, The copyright holders according to COPYING.md + + +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/README.md b/README.md new file mode 100644 index 0000000..bc7834e --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# Welcome to project W + +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/JulianFP/project-W/ci.yml?branch=main)](https://github.com/JulianFP/project-W/actions/workflows/ci.yml) +[![Documentation Status](https://readthedocs.org/projects/project-W/badge/)](https://project-W.readthedocs.io/) +[![codecov](https://codecov.io/gh/JulianFP/project-W/branch/main/graph/badge.svg)](https://codecov.io/gh/JulianFP/project-W) + +## Installation + +The Python package `project_W` can be installed from PyPI: + +``` +python -m pip install project_W +``` + +## Development installation + +If you want to contribute to the development of `project_W`, we recommend +the following editable installation from this repository: + +``` +git clone git@github.com:JulianFP/project-W.git +cd project-W +python -m pip install --editable .[tests] +``` + +Having done so, the test suite can be run using `pytest`: + +``` +python -m pytest +``` + +## Acknowledgments + +This repository was set up using the [SSC Cookiecutter for Python Packages](https://github.com/ssciwr/cookiecutter-python-package). diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..45e3f33 --- /dev/null +++ b/TODO.md @@ -0,0 +1,15 @@ +This TODO list is automatically generated from the cookiecutter-python-project template. +The following tasks need to be done to get a fully working project: + +* Push to your remote repository for the first time by doing `git push origin main`. +* Add the secret variable `PYPI_API_TOKEN` to your GitHub project. This can be done in your + use settings at `https://pypi.org`. Note that currently, you have to create an unscoped token + for your first upload and only after that you can create a new token whose scope is restricted + to the current project. +* Enable the integration of Readthedocs with your Git hoster. In the case of Github, this means + that you need to login at [Read the Docs](https://readthedocs.org) and click the button + *Import a Project*. +* Enable the integration with `codecov.io` by heading to the [Codecov.io Website](https://codecov.io), + log in (e.g. with your Github credentials) and enable integration for your repository. This will + allow you to have automatic coverage reports on pull requests, but is not necessary to display + the coverage badge in the README. \ No newline at end of file diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..3665ae9 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,10 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "70...100" + +ignore: + - "**/tests" diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..b507a95 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/doc/api.rst b/doc/api.rst new file mode 100644 index 0000000..1400462 --- /dev/null +++ b/doc/api.rst @@ -0,0 +1,9 @@ +User API +======== + +.. toctree:: + +This is an example function: + +.. automodule:: project_W + :members: diff --git a/doc/conf.py b/doc/conf.py new file mode 100644 index 0000000..8f14428 --- /dev/null +++ b/doc/conf.py @@ -0,0 +1,45 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + + +# -- Project information ----------------------------------------------------- + +project = 'project-W' +copyright = '2023, Julian Partanen' +author = 'Julian Partanen' + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "nbsphinx", + "nbsphinx_link", + "sphinx_mdinclude", + "sphinx.ext.autodoc", + "sphinx_rtd_theme", +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = [] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'sphinx_rtd_theme' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = [] diff --git a/doc/demo.nblink b/doc/demo.nblink new file mode 100644 index 0000000..cf1ae47 --- /dev/null +++ b/doc/demo.nblink @@ -0,0 +1,3 @@ +{ + "path": "../notebooks/demo.ipynb" +} \ No newline at end of file diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 0000000..2fcf621 --- /dev/null +++ b/doc/index.rst @@ -0,0 +1,17 @@ +project W +========= + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + intro + demo + api + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` \ No newline at end of file diff --git a/doc/intro.rst b/doc/intro.rst new file mode 100644 index 0000000..e2618b8 --- /dev/null +++ b/doc/intro.rst @@ -0,0 +1 @@ +.. mdinclude:: ../README.md \ No newline at end of file diff --git a/doc/make.bat b/doc/make.bat new file mode 100644 index 0000000..3d64bb3 --- /dev/null +++ b/doc/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/notebooks/demo.ipynb b/notebooks/demo.ipynb new file mode 100644 index 0000000..a3e9c6e --- /dev/null +++ b/notebooks/demo.ipynb @@ -0,0 +1,57 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "819be38a-921a-485a-8e1f-58daeadc14ac", + "metadata": {}, + "source": [ + "# Demo of the project_W package" + ] + }, + { + "cell_type": "markdown", + "id": "55984bca-1e25-45f9-8c31-ce080b2cdcfb", + "metadata": {}, + "source": [ + "In the following we will demonstrate the project_W package. It is currently capable of doing impressive things:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "89c489c7-9c94-43ee-9696-a4e56681fd8f", + "metadata": {}, + "outputs": [], + "source": [ + "import project_W" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e2913ab6-3ae7-40ae-84ef-258bc757676c", + "metadata": {}, + "outputs": [], + "source": [ + "project_W.add_one(1)" + ] + }, + { + "cell_type": "markdown", + "id": "eb8e87dc-5e78-4b1c-b880-a948658b13d9", + "metadata": {}, + "source": [ + "There you go: `1+1=2`!" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/project_W/__init__.py b/project_W/__init__.py new file mode 100644 index 0000000..ac1cc9f --- /dev/null +++ b/project_W/__init__.py @@ -0,0 +1,11 @@ +# The version file is generated automatically by setuptools_scm +from project_W._version import version as __version__ + + +def add_one(x: int): + """An example function that increases a number + + :param x: The input parameter to increase + :return: The successor of the given number + """ + return x + 1 diff --git a/project_W/__main__.py b/project_W/__main__.py new file mode 100644 index 0000000..027945e --- /dev/null +++ b/project_W/__main__.py @@ -0,0 +1,10 @@ +import click + + +@click.command() +def main(): + click.echo("This is project_W's command line interface.") + + +if __name__ == "__main__": + main() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..33445cc --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,73 @@ +# This section describes the requirements of the build/installation +# process itself. Being able to do this was the original reason to +# introduce pyproject.toml +[build-system] +requires = [ + "setuptools >=61", + "setuptools_scm >=7", +] +build-backend = "setuptools.build_meta" + +# This section provides general project metadata that is used across +# a variety of build tools. Notably, the version specified here is the +# single source of truth for project_W's version +[project] +name = "project_W" +description = "Add short description here" +readme = "README.md" +maintainers = [ + { name = "Julian Partanen", email = "your@email.com" }, +] +dynamic = ["version"] +requires-python = ">=3.8" +license = { text = "MIT" } +classifiers = [ + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", + "License :: OSI Approved :: MIT License", +] +dependencies = [ + "click", +] + +[project.optional-dependencies] +tests = [ + "pytest", + "pytest-cov", + "nbval", +] +docs = [ + "ipykernel", + "nbsphinx", + "nbsphinx-link", + "sphinx", + "sphinx_mdinclude", + "sphinx_rtd_theme", +] + +# Command line scripts installed as part of the installation +[project.scripts] +project_W = "project_W.__main__:main" + +# The following section contains setuptools-specific configuration +# options. For a full reference of available options, check the overview +# at https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html +[tool.setuptools] +packages = [ + "project_W", +] + +# Configure setuptools_scm, which extracts the version number from +# the version control system. For more information see its documentation: +# https://github.com/pypa/setuptools_scm +[tool.setuptools_scm] +version_scheme = "post-release" +local_scheme = "node-and-date" +write_to = "project_W/_version.py" + +# The following is the configuration for the pytest test suite +[tool.pytest.ini_options] +testpaths = [ + "tests", + "notebooks", +] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..b024da8 --- /dev/null +++ b/setup.py @@ -0,0 +1,4 @@ +from setuptools import setup + + +setup() diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_cli.py b/tests/test_cli.py new file mode 100644 index 0000000..75ec5c3 --- /dev/null +++ b/tests/test_cli.py @@ -0,0 +1,9 @@ +from project_W.__main__ import main + +from click.testing import CliRunner + + +def test_project_W_cli(): + runner = CliRunner() + result = runner.invoke(main, ()) + assert result.exit_code == 0 diff --git a/tests/test_project_W.py b/tests/test_project_W.py new file mode 100644 index 0000000..697859d --- /dev/null +++ b/tests/test_project_W.py @@ -0,0 +1,5 @@ +import project_W + + +def test_project_W(): + assert project_W.add_one(1) == 2