]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Test and dev dependencies expressed as extras
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 23 Aug 2020 15:41:19 +0000 (16:41 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 23 Aug 2020 15:41:19 +0000 (16:41 +0100)
README.rst
psycopg3/setup.cfg
psycopg3/tox.ini
psycopg3_c/tox.ini

index 51ca1d1e6fe352c35d3c81fce2e868cb89eef33c..0e3580fa8620fdbd696d9295aacd629e90fe31f3 100644 (file)
@@ -28,23 +28,26 @@ can install it from source using::
 Hacking
 -------
 
-We assume you have built your virtualenv and ``pip`` just works and ``python``
-refers to Python 3. You can set up a dev environment with::
+You can create a local virtualenv and install there the dev and test
+requirements. Feel free to adapt the following recipe if you follow a
+different development pattern::
 
-    python psycopg3/setup.py develop    # for the base Python pacakge
-    python psycopg3_c/setup.py develop  # for the C extension module
+    python -m venv .venv
+    source .venv/bin/activate
+    pip -e/setup.py[dev,test] develop    # for the base Python pacakge
+    pip -e psycopg3_c/setup.py develop   # for the C extension module
 
-All the available tests and dev support are defined in the ``tox.ini`` files
-in this directory and in the package directories: please refer to `tox
-documentation`__ for its usage. You can run all the tests with::
+You can use tox to validate the code::
+
+    tox -p4
+
+and to run the tests::
 
     psql -c 'create database psycopg3_test'
     export PSYCOPG3_TEST_DSN="dbname=psycopg3_test"
     tox -c psycopg3 -s
     tox -c psycopg3_c -s
 
-and validate the code before submission running::
-
-    tox -p4
-
-.. __: https://tox.readthedocs.io/
+Please look at the commands definitions in the ``tox.ini`` files if you want
+to run some of the commands interacively: the dependency should be already in
+your virtualenv.
index fef979d3f15e8835c30a8fa999805e9d572edc2c..9e09f62677e24de2c79e0f96e10fdfeafd896c1a 100644 (file)
@@ -32,3 +32,14 @@ zip_safe = False
 include_package_data = True
 install_requires =
     typing_extensions
+
+[options.extras_require]
+test =
+    pytest >= 6, < 6.1
+    pytest-asyncio >= 0.14.0, < 0.15
+
+dev =
+    tox
+    black
+    flake8 >= 3.8, < 3.9
+    mypy >= 0.782
index 8ba46fefe1efce3235be6dd36637cbb136a20052..f5f2097589214bbfcf028a20e7f0ab57f12fee70 100644 (file)
@@ -6,6 +6,4 @@ isolated_build = True
 commands =
     pytest ../tests {posargs}
 passenv = PG* PSYCOPG3_TEST_DSN PYTEST_ADDOPTS PSYCOPG3_IMPL
-deps =
-    pytest >= 6, < 6.1
-    pytest-asyncio >= 0.14.0, < 0.15
+extras = test
index 7d7ed1624fcb7e030a97d63f5ada4ea613e1d086..87eec1540a78a09a2c549495ac38236dd148174a 100644 (file)
@@ -7,6 +7,4 @@ commands =
     pytest ../tests {posargs}
 passenv = PG* PSYCOPG3_TEST_DSN PYTEST_ADDOPTS PSYCOPG3_IMPL
 deps =
-    pytest >= 6, < 6.1
-    pytest-asyncio >= 0.14.0, < 0.15
-    -e {toxinidir}/../psycopg3
+    -e {toxinidir}/../psycopg3[test]