diff --git a/.circleci/config.yml b/.circleci/config.yml index 599de045f..3b626a6e1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,8 +9,6 @@ jobs: - run: name: Install requirements and run tests command: | - virtualenv venv - source venv/bin/activate - pip3 install -r requirements/requirements-dev.txt + pipenv install --dev export PYTHONPATH=$PYTHONPATH:. # so alembic can get to Base metadata - pytest -v + pipenv run pytest -v diff --git a/Makefile b/Makefile deleted file mode 100644 index 3ea765fe6..000000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -DEFAULT_GOAL: help - -.PHONY: update-pip-requirements -update-pip-requirements: ## Updates all Python requirements files via pip-compile. - pip-compile --generate-hashes --output-file requirements/requirements.txt requirements/requirements.in - pip-compile --generate-hashes --output-file requirements/requirements-dev.txt requirements/requirements-dev.in requirements/requirements.in - -# Explaination of the below shell command should it ever break. -# 1. Set the field separator to ": ##" and any make targets that might appear between : and ## -# 2. Use sed-like syntax to remove the make targets -# 3. Format the split fields into $$1) the target name (in blue) and $$2) the target descrption -# 4. Pass this file as an arg to awk -# 5. Sort it alphabetically -# 6. Format columns with colon as delimiter. -.PHONY: help -help: ## Print this message and exit. - @printf "Makefile for working on the Python SecureDrop client.\n" - @printf "Subcommands:\n\n" - @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) \ - | sort \ - | column -s ':' -t diff --git a/Pipfile b/Pipfile new file mode 100644 index 000000000..808d54fac --- /dev/null +++ b/Pipfile @@ -0,0 +1,7 @@ +[packages] +SQLALchemy = "*" +alembic = "*" + +[dev-packages] +pytest = "*" +pip-tools = "*" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 000000000..1fcbcb4c1 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,140 @@ +{ + "_meta": { + "hash": { + "sha256": "a4ca821548e61e12ff5e8e1d8877605cf294ac9ae024dbc79f69aff05563bae9" + }, + "pipfile-spec": 6, + "requires": {}, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.python.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "alembic": { + "hashes": [ + "sha256:52d73b1d750f1414fa90c25a08da47b87de1e4ad883935718a8f36396e19e78e", + "sha256:eb7db9b4510562ec37c91d00b00d95fde076c1030d3f661aea882eec532b3565" + ], + "index": "pypi", + "version": "==1.0.0" + }, + "mako": { + "hashes": [ + "sha256:4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae" + ], + "version": "==1.0.7" + }, + "markupsafe": { + "hashes": [ + "sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" + ], + "version": "==1.0" + }, + "python-dateutil": { + "hashes": [ + "sha256:1adb80e7a782c12e52ef9a8182bebeb73f1d7e24e374397af06fb4956c8dc5c0", + "sha256:e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8" + ], + "version": "==2.7.3" + }, + "python-editor": { + "hashes": [ + "sha256:a3c066acee22a1c94f63938341d4fb374e3fdd69366ed6603d7b24bed1efc565" + ], + "version": "==1.0.3" + }, + "six": { + "hashes": [ + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + ], + "version": "==1.11.0" + }, + "sqlalchemy": { + "hashes": [ + "sha256:72325e67fb85f6e9ad304c603d83626d1df684fdf0c7ab1f0352e71feeab69d8" + ], + "index": "pypi", + "version": "==1.2.10" + } + }, + "develop": { + "atomicwrites": { + "hashes": [ + "sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585", + "sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6" + ], + "version": "==1.1.5" + }, + "attrs": { + "hashes": [ + "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265", + "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" + ], + "version": "==18.1.0" + }, + "click": { + "hashes": [ + "sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d", + "sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b" + ], + "version": "==6.7" + }, + "first": { + "hashes": [ + "sha256:3bb3de3582cb27071cfb514f00ed784dc444b7f96dc21e140de65fe00585c95e", + "sha256:41d5b64e70507d0c3ca742d68010a76060eea8a3d863e9b5130ab11a4a91aa0e" + ], + "version": "==2.0.1" + }, + "more-itertools": { + "hashes": [ + "sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092", + "sha256:c476b5d3a34e12d40130bc2f935028b5f636df8f372dc2c1c01dc19681b2039e", + "sha256:fcbfeaea0be121980e15bc97b3817b5202ca73d0eae185b4550cbfce2a3ebb3d" + ], + "version": "==4.3.0" + }, + "pip-tools": { + "hashes": [ + "sha256:90bbe6731a6a34d339bf14d90cf2892475386c7d06c458208191ac9992110e0a", + "sha256:f11fc3bf1d87a0b4a68d4d595f619814e2396e92d75d7bdd2500edbf002ea6de" + ], + "index": "pypi", + "version": "==2.0.2" + }, + "pluggy": { + "hashes": [ + "sha256:6e3836e39f4d36ae72840833db137f7b7d35105079aee6ec4a62d9f80d594dd1", + "sha256:95eb8364a4708392bae89035f45341871286a333f749c3141c20573d2b3876e1" + ], + "version": "==0.7.1" + }, + "py": { + "hashes": [ + "sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7", + "sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e" + ], + "version": "==1.5.4" + }, + "pytest": { + "hashes": [ + "sha256:8214ab8446104a1d0c17fbd218ec6aac743236c6ffbe23abc038e40213c60b88", + "sha256:e2b2c6e1560b8f9dc8dd600b0923183fbd68ba3d9bdecde04467be6dd296a384" + ], + "index": "pypi", + "version": "==3.7.0" + }, + "six": { + "hashes": [ + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + ], + "version": "==1.11.0" + } + } +} diff --git a/README.md b/README.md index f5e099c12..1ee83401c 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Qt-based client for working with SecureDrop submissions on the SecureDrop Qubes Set up a Python 3 virtual environment and set up dependencies: ``` -mkvirtualenv --python=python3 securedropclient -pip install -r requirements/requirements-dev.txt +pipenv install +pipenv shell ``` ## Run tests diff --git a/requirements/requirements-dev.in b/requirements/requirements-dev.in deleted file mode 100644 index d84f59f5d..000000000 --- a/requirements/requirements-dev.in +++ /dev/null @@ -1,2 +0,0 @@ -pip-tools -pytest diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt deleted file mode 100644 index a2f617b14..000000000 --- a/requirements/requirements-dev.txt +++ /dev/null @@ -1,63 +0,0 @@ -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --generate-hashes --output-file requirements/requirements-dev.txt requirements/requirements-dev.in requirements/requirements.in -# -alembic==1.0.0 \ - --hash=sha256:52d73b1d750f1414fa90c25a08da47b87de1e4ad883935718a8f36396e19e78e \ - --hash=sha256:eb7db9b4510562ec37c91d00b00d95fde076c1030d3f661aea882eec532b3565 -atomicwrites==1.1.5 \ - --hash=sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585 \ - --hash=sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6 \ - # via pytest -attrs==18.1.0 \ - --hash=sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265 \ - --hash=sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b \ - # via pytest -click==6.7 \ - --hash=sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d \ - --hash=sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b \ - # via pip-tools -first==2.0.1 \ - --hash=sha256:3bb3de3582cb27071cfb514f00ed784dc444b7f96dc21e140de65fe00585c95e \ - --hash=sha256:41d5b64e70507d0c3ca742d68010a76060eea8a3d863e9b5130ab11a4a91aa0e \ - # via pip-tools -mako==1.0.7 \ - --hash=sha256:4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae \ - # via alembic -markupsafe==1.0 \ - --hash=sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665 \ - # via mako -more-itertools==4.2.0 \ - --hash=sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8 \ - --hash=sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3 \ - --hash=sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0 \ - # via pytest -pip-tools==2.0.2 \ - --hash=sha256:90bbe6731a6a34d339bf14d90cf2892475386c7d06c458208191ac9992110e0a \ - --hash=sha256:f11fc3bf1d87a0b4a68d4d595f619814e2396e92d75d7bdd2500edbf002ea6de -pluggy==0.7.1 \ - --hash=sha256:6e3836e39f4d36ae72840833db137f7b7d35105079aee6ec4a62d9f80d594dd1 \ - --hash=sha256:95eb8364a4708392bae89035f45341871286a333f749c3141c20573d2b3876e1 \ - # via pytest -py==1.5.4 \ - --hash=sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7 \ - --hash=sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e \ - # via pytest -pytest==3.6.4 \ - --hash=sha256:341ec10361b64a24accaec3c7ba5f7d5ee1ca4cebea30f76fad3dd12db9f0541 \ - --hash=sha256:952c0389db115437f966c4c2079ae9d54714b9455190e56acebe14e8c38a7efa -python-dateutil==2.7.3 \ - --hash=sha256:1adb80e7a782c12e52ef9a8182bebeb73f1d7e24e374397af06fb4956c8dc5c0 \ - --hash=sha256:e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8 \ - # via alembic -python-editor==1.0.3 \ - --hash=sha256:a3c066acee22a1c94f63938341d4fb374e3fdd69366ed6603d7b24bed1efc565 \ - # via alembic -six==1.11.0 \ - --hash=sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9 \ - --hash=sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb \ - # via more-itertools, pip-tools, pytest, python-dateutil -sqlalchemy==1.2.10 \ - --hash=sha256:72325e67fb85f6e9ad304c603d83626d1df684fdf0c7ab1f0352e71feeab69d8 diff --git a/requirements/requirements.in b/requirements/requirements.in deleted file mode 100644 index 82bd95b54..000000000 --- a/requirements/requirements.in +++ /dev/null @@ -1,2 +0,0 @@ -alembic -SQLALchemy diff --git a/requirements/requirements.txt b/requirements/requirements.txt deleted file mode 100644 index 912180c44..000000000 --- a/requirements/requirements.txt +++ /dev/null @@ -1,28 +0,0 @@ -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --generate-hashes --output-file requirements/requirements.txt requirements/requirements.in -# -alembic==1.0.0 \ - --hash=sha256:52d73b1d750f1414fa90c25a08da47b87de1e4ad883935718a8f36396e19e78e \ - --hash=sha256:eb7db9b4510562ec37c91d00b00d95fde076c1030d3f661aea882eec532b3565 -mako==1.0.7 \ - --hash=sha256:4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae \ - # via alembic -markupsafe==1.0 \ - --hash=sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665 \ - # via mako -python-dateutil==2.7.3 \ - --hash=sha256:1adb80e7a782c12e52ef9a8182bebeb73f1d7e24e374397af06fb4956c8dc5c0 \ - --hash=sha256:e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8 \ - # via alembic -python-editor==1.0.3 \ - --hash=sha256:a3c066acee22a1c94f63938341d4fb374e3fdd69366ed6603d7b24bed1efc565 \ - # via alembic -six==1.11.0 \ - --hash=sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9 \ - --hash=sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb \ - # via python-dateutil -sqlalchemy==1.2.10 \ - --hash=sha256:72325e67fb85f6e9ad304c603d83626d1df684fdf0c7ab1f0352e71feeab69d8