# -*- coding: utf-8 -*-
from setuptools import setup

package_dir = \
{'': 'src'}

packages = \
['nox_poetry']

package_data = \
{'': ['*']}

install_requires = \
['nox>=2020.5.24,<2021.0.0', 'tomlkit>=0.7.0,<0.8.0']

setup_kwargs = {
    'name': 'nox-poetry',
    'version': '0.7.1',
    'description': 'nox-poetry',
    'long_description': 'nox-poetry\n==========\n\n|Status| |PyPI| |Python Version| |License|\n\n|Read the Docs| |Tests| |Codecov|\n\n|pre-commit| |Black|\n\n.. |Status| image:: https://badgen.net/badge/status/alpha/d8624d\n   :target: https://badgen.net/badge/status/alpha/d8624d\n   :alt: Project Status\n.. |PyPI| image:: https://img.shields.io/pypi/v/nox-poetry.svg\n   :target: https://pypi.org/project/nox-poetry/\n   :alt: PyPI\n.. |Python Version| image:: https://img.shields.io/pypi/pyversions/nox-poetry\n   :target: https://pypi.org/project/nox-poetry\n   :alt: Python Version\n.. |License| image:: https://img.shields.io/pypi/l/nox-poetry\n   :target: https://opensource.org/licenses/MIT\n   :alt: License\n.. |Read the Docs| image:: https://img.shields.io/readthedocs/nox-poetry/latest.svg?label=Read%20the%20Docs\n   :target: https://nox-poetry.readthedocs.io/\n   :alt: Read the documentation at https://nox-poetry.readthedocs.io/\n.. |Tests| image:: https://github.com/cjolowicz/nox-poetry/workflows/Tests/badge.svg\n   :target: https://github.com/cjolowicz/nox-poetry/actions?workflow=Tests\n   :alt: Tests\n.. |Codecov| image:: https://codecov.io/gh/cjolowicz/nox-poetry/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/cjolowicz/nox-poetry\n   :alt: Codecov\n.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white\n   :target: https://github.com/pre-commit/pre-commit\n   :alt: pre-commit\n.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/psf/black\n   :alt: Black\n\n\nUse Poetry_ inside Nox_ sessions\n\nThis package provides a drop-in replacement for ``session.install`` in Nox sessions.\nIt modifies its behavior in two ways:\n\n- Packages are pinned to the versions specified in Poetry\'s lock file.\n- The argument ``"."`` is replaced by a wheel built from the package.\n\n\nInstallation\n------------\n\nInstall ``nox-poetry`` from the Python Package Index:\n\n.. code:: console\n\n   $ pip install nox-poetry\n\n\n**Important:**\nThis package must be installed into the same environment that Nox is run from.\nIf you installed Nox using pipx_,\nuse the following command to install this package into the same environment:\n\n.. code:: console\n\n   $ pipx inject nox nox-poetry\n\n\nUsage\n-----\n\nImport ``nox_poetry.patch`` at the top of your ``noxfile.py``.\n\n``nox-poetry`` intercepts calls to ``session.install``\nand uses Poetry to export a `constraints file`_ and build the package behind the scenes.\nAll packages installed in Nox sessions must be managed as dependencies in Poetry.\n\nFor example, the following Nox session runs your test suite:\n\n.. code:: python\n\n   # noxfile.py\n   import nox\n   import nox_poetry.patch\n   from nox.sessions import Session\n\n   @nox.session\n   def tests(session: Session) -> None:\n       """Run the test suite."""\n       session.install(".")\n       session.install("pytest")\n       session.run("pytest")\n\nMore precisely, the session builds a wheel from the local package,\ninstalls the wheel as well as the ``pytest`` package, and\ninvokes ``pytest`` to run the test suite against the installation.\n\nIf you prefer a more explicit approach,\ninvoke ``nox_poetry.install`` and ``nox_poetry.installroot`` instead of ``session.install``.\nUse the ``nox_poetry.WHEEL`` or ``nox_poetry.SDIST`` constants to specify the distribution format for the local package.\n\nHere is the example above using the more explicit approach:\n\n.. code:: python\n\n   # noxfile.py\n   import nox\n   import nox_poetry\n   from nox.sessions import Session\n\n   @nox.session\n   def tests(session: Session) -> None:\n       """Run the test suite."""\n       nox_poetry.installroot(session, distribution_format=nox_poetry.WHEEL)\n       #nox_poetry.install(session, ".")  # this is equivalent to the statement above\n       nox_poetry.install(session, "pytest")\n       session.run("pytest")\n\n\nWhy?\n----\n\nConsider what would happen in the first version without the line importing ``nox-poetry.patch``:\n\n- Package dependencies would only be constrained by the wheel metadata, not by the lock file.\n  In other words, their versions would not be *pinned*.\n- The ``pytest`` dependency would not be constrained at all.\n- Poetry would be installed as a build backend every time\n  (although this could be avoided by passing the option ``--no-build-isolation``).\n\nUnpinned dependencies mean that your checks are not reproducible and deterministic,\nwhich can lead to surprises in Continuous Integration and when collaborating with others.\nYou can solve these issues by declaring ``pytest`` as a development dependency,\nand installing your package and its dependencies using ``poetry install``:\n\n.. code:: python\n\n   @nox.session\n   def tests(session: Session) -> None:\n       """Run the test suite."""\n       session.run("poetry", "install", external=True)\n       session.run("pytest")\n\nUnfortunately, this approach comes with its own set of problems:\n\n- Checks run against an editable installation of your package,\n  i.e. your local copy of the code, instead of the installed wheel your users see.\n  In the best case, any mistakes will still be caught during Continuous Integration.\n  In the worst case, you publish a buggy release because you forgot to commit some changes.\n- The package is installed, as well as all of its core and development dependencies,\n  no matter which tools a session actually runs.\n  Code formatters or linters, for example, don\'t need your package installed at all.\n  Besides being wasteful, it goes against the idea of running checks in isolated environments.\n\n``nox-poetry`` uses a third approach:\n\n- Installations are performed by pip, via the ``session.install`` method.\n- When installing your own package, Poetry is used to build a wheel, which is passed to pip.\n- When installing third-party packages, Poetry is used to export a `constraints file`_,\n  which is passed to pip along with the packages.\n  The constraints file ensures that package versions are pinned by the lock file,\n  without forcing an installation of every listed dependency and sub-dependency.\n\nIn summary, this approach brings the following advantages:\n\n- You can manage tools like ``pytest`` as development dependencies in Poetry.\n- Dependencies are pinned by Poetry\'s lock file, making checks predictable and deterministic.\n- You can run checks against an installed wheel, instead of your local copy of the code.\n- Every tool can run in an isolated environment with minimal dependencies.\n- No need to install your package with all its dependencies if all you need is some linter.\n\nFor more details, take a look at `this article`__.\n\n__ https://cjolowicz.github.io/posts/hypermodern-python-03-linting/#managing-dependencies-in-nox-sessions-with-poetry\n\n\nContributing\n------------\n\nContributions are very welcome.\nTo learn more, see the `Contributor Guide`_.\n\n\nLicense\n-------\n\n``nox-poetry`` is free and open source software,\ndistributed under the terms of the MIT_ license.\n\n\nIssues\n------\n\nIf you encounter any problems,\nplease `file an issue`_ along with a detailed description.\n\n\nCredits\n-------\n\nThis project was generated from `@cjolowicz`_\'s `Hypermodern Python Cookiecutter`_ template.\n\n\n.. _@cjolowicz: https://github.com/cjolowicz\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _Hypermodern Python Cookiecutter: https://github.com/cjolowicz/cookiecutter-hypermodern-python\n.. _MIT: http://opensource.org/licenses/MIT\n.. _Nox: https://nox.thea.codes/\n.. _Poetry: https://python-poetry.org/\n.. _constraints file: https://pip.pypa.io/en/stable/user_guide/#constraints-files\n.. _file an issue: https://github.com/cjolowicz/nox-poetry/issues\n.. _nox.sessions.Session.install: https://nox.thea.codes/en/stable/config.html#nox.sessions.Session.install\n.. _nox.sessions.Session.run: https://nox.thea.codes/en/stable/config.html#nox.sessions.Session.run\n.. _pip install: https://pip.pypa.io/en/stable/reference/pip_install/\n.. _pip: https://pip.pypa.io/\n.. _pipx: https://pipxproject.github.io/pipx/\n.. github-only\n.. _Contributor Guide: CONTRIBUTING.rst\n',
    'author': 'Claudio Jolowicz',
    'author_email': 'mail@claudiojolowicz.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/cjolowicz/nox-poetry',
    'package_dir': package_dir,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.6.1,<4.0.0',
}


setup(**setup_kwargs)
