]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Added hacking info to readme
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 21 May 2020 04:49:07 +0000 (16:49 +1200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 21 May 2020 05:37:37 +0000 (17:37 +1200)
tox definitions and tools configurations tweaked to work out of the box.

Close #3

.gitignore
README.rst
tox.ini

index 093befee0bf5fba92622b0dadebf121ed7a76786..ce69c0448fa0de261cf0f47a3ca0449d94b93e3f 100644 (file)
@@ -1,7 +1,8 @@
-env
 /psycopg3.egg-info
 /.tox
 /.eggs
 /build
 /dist
 *.pstats
+/.mypy_cache
+__pycache__/
index 9549a20b94ddd82a4ba4ec2b22c538e21beddf47..197b9a9d5602ed67aac75468fea6a0e29b346577 100644 (file)
@@ -11,3 +11,24 @@ The library is still in early development stage. If you want to try it out you
 can install it from source using::
 
     pip install -e git+https://github.com/psycopg/psycopg3.git#egg=psycopg3
+
+
+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::
+
+    python setup.py develop
+
+All the available tests and dev support are defined in ``tox.ini``: please
+refer to `tox documentation`__ for its usage. You can run all the tests with::
+
+    psql -c 'create database psycopg3_test'
+    tox -s
+
+You can use the ``PSYCOPG3_TEST_DSN`` env var to select a different database
+to run the tests. You can install the test dependencies in your virtualenv to
+run the tests faster: please look at the ``tox.ini`` comments for instructions.
+
+.. __: https://tox.readthedocs.io/
diff --git a/tox.ini b/tox.ini
index 6239af8105caa5c794f28c43933b89c177d8c4fc..aca0c558772ebce0428ec86e0971eab38e9aadfb 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,3 +1,17 @@
+# Tox is nice, but rebuilding the environment every time is kinda slow.
+# If you want to install the test environments defined here into your current
+# virtualenv you can use:
+#
+#   pip install tox tox-current-env
+#   tox --print-deps-to-file /tmp/requirements.txt
+#   pip install -r /tmp/requirements.txt
+#
+# After which you can run the tests with:
+#
+#   tox --current-env -e ENV
+#
+# or just run manually the ``commands`` defined here.
+
 [tox]
 envlist = py{36,37,38}, black, flake8, mypy
 
@@ -18,7 +32,7 @@ deps = black
 
 [testenv:flake8]
 commands = flake8
-deps = flake8 >= 3.7
+deps = flake8 >= 3.8, < 3.9
 
 [testenv:mypy]
 commands = mypy --config-file tox.ini
@@ -26,8 +40,8 @@ deps = mypy >= 0.770
 
 [flake8]
 max-line-length = 85
-exclude = env, .tox, .eggs
 ignore = W503, E203
+extend-exclude = .venv
 
 [mypy]
 files = psycopg3