Metadata-Version: 2.1
Name: pyproject-examples
Version: 2023.6.30
Summary: Example pyproject.toml configs for testing.
Author-email: Dominic Davis-Foster <dominic@davis-foster.co.uk>
License: Copyright (c) 2021 Dominic Davis-Foster
        
        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.
        
Project-URL: Homepage, https://github.com/repo-helper/pyproject-examples
Project-URL: Issue Tracker, https://github.com/repo-helper/pyproject-examples/issues
Project-URL: Source Code, https://github.com/repo-helper/pyproject-examples
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
License-File: LICENSE

###################
pyproject-examples
###################

.. start short_desc

**Example pyproject.toml configs for testing.**

.. end short_desc

These are designed to be used in the testsuite for
`pyproject-parser <https://github.com/repo-helper/pyproject-parser>`_
and `whey <https://github.com/repo-helper/whey>`_,
but may be useful for other tools based on those.

.. start shields

.. list-table::
	:stub-columns: 1
	:widths: 10 90

	* - Tests
	  - |actions_linux| |actions_windows| |actions_macos|
	* - PyPI
	  - |pypi-version| |supported-versions| |supported-implementations| |wheel|
	* - Activity
	  - |commits-latest| |commits-since| |maintained| |pypi-downloads|
	* - QA
	  - |codefactor| |actions_flake8| |actions_mypy|
	* - Other
	  - |license| |language| |requires|

.. |actions_linux| image:: https://github.com/repo-helper/pyproject-examples/workflows/Linux/badge.svg
	:target: https://github.com/repo-helper/pyproject-examples/actions?query=workflow%3A%22Linux%22
	:alt: Linux Test Status

.. |actions_windows| image:: https://github.com/repo-helper/pyproject-examples/workflows/Windows/badge.svg
	:target: https://github.com/repo-helper/pyproject-examples/actions?query=workflow%3A%22Windows%22
	:alt: Windows Test Status

.. |actions_macos| image:: https://github.com/repo-helper/pyproject-examples/workflows/macOS/badge.svg
	:target: https://github.com/repo-helper/pyproject-examples/actions?query=workflow%3A%22macOS%22
	:alt: macOS Test Status

.. |actions_flake8| image:: https://github.com/repo-helper/pyproject-examples/workflows/Flake8/badge.svg
	:target: https://github.com/repo-helper/pyproject-examples/actions?query=workflow%3A%22Flake8%22
	:alt: Flake8 Status

.. |actions_mypy| image:: https://github.com/repo-helper/pyproject-examples/workflows/mypy/badge.svg
	:target: https://github.com/repo-helper/pyproject-examples/actions?query=workflow%3A%22mypy%22
	:alt: mypy status

.. |requires| image:: https://dependency-dash.repo-helper.uk/github/repo-helper/pyproject-examples/badge.svg
	:target: https://dependency-dash.repo-helper.uk/github/repo-helper/pyproject-examples/
	:alt: Requirements Status

.. |codefactor| image:: https://img.shields.io/codefactor/grade/github/repo-helper/pyproject-examples?logo=codefactor
	:target: https://www.codefactor.io/repository/github/repo-helper/pyproject-examples
	:alt: CodeFactor Grade

.. |pypi-version| image:: https://img.shields.io/pypi/v/pyproject-examples
	:target: https://pypi.org/project/pyproject-examples/
	:alt: PyPI - Package Version

.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/pyproject-examples?logo=python&logoColor=white
	:target: https://pypi.org/project/pyproject-examples/
	:alt: PyPI - Supported Python Versions

.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/pyproject-examples
	:target: https://pypi.org/project/pyproject-examples/
	:alt: PyPI - Supported Implementations

.. |wheel| image:: https://img.shields.io/pypi/wheel/pyproject-examples
	:target: https://pypi.org/project/pyproject-examples/
	:alt: PyPI - Wheel

.. |license| image:: https://img.shields.io/github/license/repo-helper/pyproject-examples
	:target: https://github.com/repo-helper/pyproject-examples/blob/master/LICENSE
	:alt: License

.. |language| image:: https://img.shields.io/github/languages/top/repo-helper/pyproject-examples
	:alt: GitHub top language

.. |commits-since| image:: https://img.shields.io/github/commits-since/repo-helper/pyproject-examples/v2023.6.30
	:target: https://github.com/repo-helper/pyproject-examples/pulse
	:alt: GitHub commits since tagged version

.. |commits-latest| image:: https://img.shields.io/github/last-commit/repo-helper/pyproject-examples
	:target: https://github.com/repo-helper/pyproject-examples/commit/master
	:alt: GitHub last commit

.. |maintained| image:: https://img.shields.io/maintenance/yes/2023
	:alt: Maintenance

.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/pyproject-examples
	:target: https://pypi.org/project/pyproject-examples/
	:alt: PyPI - Downloads

.. end shields

Installation
--------------

.. start installation

``pyproject-examples`` can be installed from PyPI.

To install with ``pip``:

.. code-block:: bash

	$ python -m pip install pyproject-examples

.. end installation


Usage
--------

``pyproject-examples`` provides the following API:


``pyproject_examples`` module
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

``valid_pep621_config``
*************************

A list of `pytest params`_ for valid ``pyproject.toml`` files per `PEP 621`_.
The params contain the ``pyproject.toml`` content as a string.
Each param has its own unique ID, which can be seen in the source
`here <https://github.com/repo-helper/pyproject-examples/blob/master/pyproject_examples/__init__.py#L68>`__.

.. _pytest params: https://docs.pytest.org/en/6.2.x/reference.html#pytest-param:
.. _PEP 621: https://peps.python.org/pep-0621/


``bad_pep621_config``
*************************

A list of `pytest params`_ for invalid ``pyproject.toml`` files per `PEP 621`_.
Each param contains the ``pyproject.toml`` content (as a string),
the expected Python exception (for catching with `pytest.raises`_), and the expected exception text (for passing as the ``match`` argument to ``pytest.raises``.
Each param also has its own unique ID, which can be seen in the source `here <https://github.com/repo-helper/pyproject-examples/blob/master/pyproject_examples/__init__.py#L88>`__.

.. _pytest.raises: https://docs.pytest.org/en/6.2.x/reference.html#pytest.raises


``valid_buildsystem_config``
*******************************

A list of `pytest params`_ for valid ``[build-system]`` tables from ``pyproject.toml`` files per `PEP 517`_ and `PEP 517`_.
The params contain the ``pyproject.toml`` content as a string.
Each param has its own unique ID, which can be seen in the source
`here <https://github.com/repo-helper/pyproject-examples/blob/master/pyproject_examples/__init__.py#L191>`__.

.. _PEP 517: https://peps.python.org/pep-0517/
.. _PEP 518: https://peps.python.org/pep-0518/


``bad_buildsystem_config``
****************************

A list of `pytest params`_ for invalid ``[build-system]`` tables from ``pyproject.toml`` files per `PEP 517`_ and `PEP 517`_.
Each param contains the ``pyproject.toml`` content (as a string),
the expected Python exception (for catching with `pytest.raises`_), and the expected exception text (for passing as the ``match`` argument to ``pytest.raises``.
Each param also has its own unique ID, which can be seen in the source `here <https://github.com/repo-helper/pyproject-examples/blob/master/pyproject_examples/__init__.py#206>`__.


``pyproject_examples.example_configs`` submodule
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This module contains the example configuration files themselves.
Each file is stored as a string.

The configuration files are:

* ``MINIMAL_CONFIG``
* ``KEYWORDS``
* ``AUTHORS``
* ``UNICODE``
* ``MAINTAINERS``
* ``CLASSIFIERS``
* ``DEPENDENCIES``
* ``OPTIONAL_DEPENDENCIES``
* ``OPTIONAL_DEPENDENCIES_EMPTY_GROUP``
* ``URLS``
* ``ENTRY_POINTS``
* ``COMPLETE_PROJECT_A``
* ``COMPLETE_A``
* ``COMPLETE_B``
* ``COMPLETE_A_WITH_FILES``
* ``DYNAMIC_REQUIREMENTS``
* ``LONG_REQUIREMENTS``


``pyproject_examples.utils`` submodule
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This module contains utility functions.

``file_not_found_regex(filename: str) -> str``
************************************************

This function create a regular expression for testing ``FileNotFoundError``\s.

This is useful for testing error messages between Windows and POSIX, as well as between CPython and PyPy.

**filename** The filename which can't be found.
