mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Ported setup.py to pyproject.toml (#2555)
* Ported setup.py to pyproject.toml, refs #2553 * Make fixtures tests less flaky The in-memory fixtures table was being shared between different instances of the test client, leading to occasional errors when running the full test suite.
This commit is contained in:
parent
53e6a72a95
commit
ce4b0794b2
15 changed files with 141 additions and 147 deletions
|
|
@ -42,7 +42,7 @@ The next step is to create a virtual environment for your project and use it to
|
|||
# Install Datasette and its testing dependencies
|
||||
python3 -m pip install -e '.[test]'
|
||||
|
||||
That last line does most of the work: ``pip install -e`` means "install this package in a way that allows me to edit the source code in place". The ``.[test]`` option means "use the setup.py in this directory and install the optional testing dependencies as well".
|
||||
That last line does most of the work: ``pip install -e`` means "install this package in a way that allows me to edit the source code in place". The ``.[test]`` option means "install the optional testing dependencies as well".
|
||||
|
||||
.. _contributing_running_tests:
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ If any of your code does not conform to Black you can run this to automatically
|
|||
|
||||
::
|
||||
|
||||
reformatted ../datasette/setup.py
|
||||
reformatted ../datasette/app.py
|
||||
All done! ✨ 🍰 ✨
|
||||
1 file reformatted, 94 files left unchanged.
|
||||
|
||||
|
|
|
|||
|
|
@ -691,7 +691,7 @@ Help text (from the docstring for the function plus any defined Click arguments
|
|||
|
||||
Plugins can register multiple commands by making multiple calls to the ``@cli.command()`` decorator. Consult the `Click documentation <https://click.palletsprojects.com/>`__ for full details on how to build a CLI command, including how to define arguments and options.
|
||||
|
||||
Note that ``register_commands()`` plugins cannot used with the :ref:`--plugins-dir mechanism <writing_plugins_one_off>` - they need to be installed into the same virtual environment as Datasette using ``pip install``. Provided it has a ``setup.py`` file (see :ref:`writing_plugins_packaging`) you can run ``pip install`` directly against the directory in which you are developing your plugin like so::
|
||||
Note that ``register_commands()`` plugins cannot used with the :ref:`--plugins-dir mechanism <writing_plugins_one_off>` - they need to be installed into the same virtual environment as Datasette using ``pip install``. Provided it has a ``pyproject.toml`` file (see :ref:`writing_plugins_packaging`) you can run ``pip install`` directly against the directory in which you are developing your plugin like so::
|
||||
|
||||
pip install -e path/to/my/datasette-plugin
|
||||
|
||||
|
|
|
|||
|
|
@ -33,16 +33,16 @@ You can install these packages like so::
|
|||
|
||||
pip install pytest pytest-asyncio
|
||||
|
||||
If you are building an installable package you can add them as test dependencies to your ``setup.py`` module like this:
|
||||
If you are building an installable package you can add them as test dependencies to your ``pyproject.toml`` file like this:
|
||||
|
||||
.. code-block:: python
|
||||
.. code-block:: toml
|
||||
|
||||
setup(
|
||||
name="datasette-my-plugin",
|
||||
# ...
|
||||
extras_require={"test": ["pytest", "pytest-asyncio"]},
|
||||
tests_require=["datasette-my-plugin[test]"],
|
||||
)
|
||||
[project]
|
||||
name = "datasette-my-plugin"
|
||||
# ...
|
||||
|
||||
[project.optional-dependencies]
|
||||
test = ["pytest", "pytest-asyncio"]
|
||||
|
||||
You can then install the test dependencies like so::
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue