From ec4f737862f7aa90e6b0ef5947653afe4dce2320 Mon Sep 17 00:00:00 2001 From: Erik Hetzner Date: Wed, 22 Jun 2022 11:51:23 -0700 Subject: [PATCH] Switch to pipenv --- .python-version | 1 + .travis.yml | 10 +-- Pipfile | 24 +++++++ Pipfile.lock | 181 +++++++++++++++++++++++++++++++++++++++++++++++ README.rst | 26 +++---- requirements.txt | 12 ---- 6 files changed, 222 insertions(+), 32 deletions(-) create mode 100644 .python-version create mode 100644 Pipfile create mode 100644 Pipfile.lock delete mode 100644 requirements.txt diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..a5e3c3b --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.8.11 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 634268a..11d70e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ - language: python - python: +language: python +python: - "3.6" - script: - - pytest +before_script: + - pip install pipenv +script: + - pipenv run python -m pytest diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..24b5e49 --- /dev/null +++ b/Pipfile @@ -0,0 +1,24 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +allofplos = {editable = true, path = "./"} +certifi = "*" +chardet = "*" +charset-normalizer = "*" +idna = "*" +lxml = "*" +peewee = "*" +python-utils = "*" +requests = "*" +six = "*" +tqdm = "*" +unidecode = "*" +urllib3 = "*" + +[dev-packages] + +[requires] +python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..7a7d3be --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,181 @@ +{ + "_meta": { + "hash": { + "sha256": "3287b89451d9d71b7d5c8dc8bc0d3937980454b33b0244334fe9706e810478c4" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.8" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "allofplos": { + "editable": true, + "path": "." + }, + "certifi": { + "hashes": [ + "sha256:84c85a9078b11105f04f3036a9482ae10e4621616db313fe045dd24743a0820d", + "sha256:fe86415d55e84719d75f8b69414f6438ac3547d2078ab91b67e779ef69378412" + ], + "index": "pypi", + "version": "==2022.6.15" + }, + "chardet": { + "hashes": [ + "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa", + "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5" + ], + "index": "pypi", + "version": "==4.0.0" + }, + "charset-normalizer": { + "hashes": [ + "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597", + "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df" + ], + "index": "pypi", + "version": "==2.0.12" + }, + "idna": { + "hashes": [ + "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff", + "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" + ], + "index": "pypi", + "version": "==3.3" + }, + "lxml": { + "hashes": [ + "sha256:00f3a6f88fd5f4357844dd91a1abac5f466c6799f1b7f1da2df6665253845b11", + "sha256:024684e0c5cfa121c22140d3a0898a3a9b2ea0f0fd2c229b6658af4bdf1155e5", + "sha256:03370ec37fe562238d385e2c53089076dee53aabf8325cab964fdb04a9130fa0", + "sha256:0aa4cce579512c33373ca4c5e23c21e40c1aa1a33533a75e51b654834fd0e4f2", + "sha256:1057356b808d149bc14eb8f37bb89129f237df488661c1e0fc0376ca90e1d2c3", + "sha256:11d62c97ceff9bab94b6b29c010ea5fb6831743459bb759c917f49ba75601cd0", + "sha256:1254a79f8a67a3908de725caf59eae62d86738f6387b0a34b32e02abd6ae73db", + "sha256:1bfb791a8fcdbf55d1d41b8be940393687bec0e9b12733f0796668086d1a23ff", + "sha256:28cf04a1a38e961d4a764d2940af9b941b66263ed5584392ef875ee9c1e360a3", + "sha256:2b9c2341d96926b0d0e132e5c49ef85eb53fa92ae1c3a70f9072f3db0d32bc07", + "sha256:2d10659e6e5c53298e6d718fd126e793285bff904bb71d7239a17218f6a197b7", + "sha256:3af00ee88376022589ceeb8170eb67dacf5f7cd625ea59fa0977d719777d4ae8", + "sha256:3cf816aed8125cfc9e6e5c6c31ff94278320d591bd7970c4a0233bee0d1c8790", + "sha256:4becd16750ca5c2a1b1588269322b2cebd10c07738f336c922b658dbab96a61c", + "sha256:4cd69bca464e892ea4ed544ba6a7850aaff6f8d792f8055a10638db60acbac18", + "sha256:4e97c8fc761ad63909198acc892f34c20f37f3baa2c50a62d5ec5d7f1efc68a1", + "sha256:520461c36727268a989790aef08884347cd41f2d8ae855489ccf40b50321d8d7", + "sha256:53b0410b220766321759f7f9066da67b1d0d4a7f6636a477984cbb1d98483955", + "sha256:56e19fb6e4b8bd07fb20028d03d3bc67bcc0621347fbde64f248e44839771756", + "sha256:5a49ad78543925e1a4196e20c9c54492afa4f1502c2a563f73097e2044c75190", + "sha256:5d52e1173f52020392f593f87a6af2d4055dd800574a5cb0af4ea3878801d307", + "sha256:607224ffae9a0cf0a2f6e14f5f6bce43e83a6fbdaa647891729c103bdd6a5593", + "sha256:612ef8f2795a89ba3a1d4c8c1af84d8453fd53ee611aa5ad460fdd2cab426fc2", + "sha256:615886ee84b6f42f1bdf1852a9669b5fe3b96b6ff27f1a7a330b67ad9911200a", + "sha256:63419db39df8dc5564f6f103102c4665f7e4d9cb64030e98cf7a74eae5d5760d", + "sha256:6467626fa74f96f4d80fc6ec2555799e97fff8f36e0bfc7f67769f83e59cff40", + "sha256:65b3b5f12c6fb5611e79157214f3cd533083f9b058bf2fc8a1c5cc5ee40fdc5a", + "sha256:686565ac77ff94a8965c11829af253d9e2ce3bf0d9225b1d2eb5c4d4666d0dca", + "sha256:6af7f51a6010748fc1bb71917318d953c9673e4ae3f6d285aaf93ef5b2eb11c1", + "sha256:70a198030d26f5e569367f0f04509b63256faa76a22886280eea69a4f535dd40", + "sha256:754a1dd04bff8a509a31146bd8f3a5dc8191a8694d582dd5fb71ff09f0722c22", + "sha256:75da29a0752c8f2395df0115ac1681cefbdd4418676015be8178b733704cbff2", + "sha256:81c29c8741fa07ecec8ec7417c3d8d1e2f18cf5a10a280f4e1c3f8c3590228b2", + "sha256:9093a359a86650a3dbd6532c3e4d21a6f58ba2cb60d0e72db0848115d24c10ba", + "sha256:915ecf7d486df17cc65aeefdb680d5ad4390cc8c857cf8db3fe241ed234f856a", + "sha256:94b181dd2777890139e49a5336bf3a9a3378ce66132c665fe8db4e8b7683cde2", + "sha256:94f2e45b054dd759bed137b6e14ae8625495f7d90ddd23cf62c7a68f72b62656", + "sha256:9af19eb789d674b59a9bee5005779757aab857c40bf9cc313cb01eafac55ce55", + "sha256:9cae837b988f44925d14d048fa6a8c54f197c8b1223fd9ee9c27084f84606143", + "sha256:aa7447bf7c1a15ef24e2b86a277b585dd3f055e8890ac7f97374d170187daa97", + "sha256:b1e22f3ee4d75ca261b6bffbf64f6f178cb194b1be3191065a09f8d98828daa9", + "sha256:b5031d151d6147eac53366d6ec87da84cd4d8c5e80b1d9948a667a7164116e39", + "sha256:b62d1431b4c40cda43cc986f19b8c86b1d2ae8918cfc00f4776fdf070b65c0c4", + "sha256:b71c52d69b91af7d18c13aef1b0cc3baee36b78607c711eb14a52bf3aa7c815e", + "sha256:b7679344f2270840dc5babc9ccbedbc04f7473c1f66d4676bb01680c0db85bcc", + "sha256:bb7c1b029e54e26e01b1d1d912fc21abb65650d16ea9a191d026def4ed0859ed", + "sha256:c2a57755e366e0ac7ebdb3e9207f159c3bf1afed02392ab18453ce81f5ee92ee", + "sha256:cf9ec915857d260511399ab87e1e70fa13d6b2972258f8e620a3959468edfc32", + "sha256:d0d03b9636f1326772e6854459728676354d4c7731dae9902b180e2065ba3da6", + "sha256:d1690c4d37674a5f0cdafbc5ed7e360800afcf06928c2a024c779c046891bf09", + "sha256:d76da27f5e3e9bc40eba6ed7a9e985f57547e98cf20521d91215707f2fb57e0f", + "sha256:d882c2f3345261e898b9f604be76b61c901fbfa4ac32e3f51d5dc1edc89da3cb", + "sha256:d8e5021e770b0a3084c30dda5901d5fce6d4474feaf0ced8f8e5a82702502fbb", + "sha256:dd00d28d1ab5fa7627f5abc957f29a6338a7395b724571a8cbff8fbed83aaa82", + "sha256:e35a298691b9e10e5a5631f8f0ba605b30ebe19208dc8f58b670462f53753641", + "sha256:e4d020ecf3740b7312bacab2cb966bb720fd4d3490562d373b4ad91dd1857c0d", + "sha256:e564d5a771b4015f34166a05ea2165b7e283635c41b1347696117f780084b46d", + "sha256:ea3f2e9eb41f973f73619e88bf7bd950b16b4c2ce73d15f24a11800ce1eaf276", + "sha256:eabdbe04ee0a7e760fa6cd9e799d2b020d098c580ba99107d52e1e5e538b1ecb", + "sha256:f17b9df97c5ecdfb56c5e85b3c9df9831246df698f8581c6e111ac664c7c656e", + "sha256:f386def57742aacc3d864169dfce644a8c396f95aa35b41b69df53f558d56dd0", + "sha256:f6d23a01921b741774f35e924d418a43cf03eca1444f3fdfd7978d35a5aaab8b", + "sha256:fcdf70191f0d1761d190a436db06a46f05af60e1410e1507935f0332280c9268" + ], + "index": "pypi", + "version": "==4.9.0" + }, + "peewee": { + "hashes": [ + "sha256:48eac70be812ac84daa5400fb8e7b545e0c83adcfa05c8e2a8612f9ced4da495" + ], + "index": "pypi", + "version": "==3.15.0" + }, + "python-utils": { + "hashes": [ + "sha256:3b1c8b706e40e91280eec5fa72ea730880a166cee99afa5555b863d55664478d", + "sha256:5cb9cf295018202fb4d6abdd694a33a7f08bc0ce1bf1eab8cce80ab2cde35c07" + ], + "index": "pypi", + "version": "==3.3.3" + }, + "requests": { + "hashes": [ + "sha256:bc7861137fbce630f17b03d3ad02ad0bf978c844f3536d0edda6499dafce2b6f", + "sha256:d568723a7ebd25875d8d1eaf5dfa068cd2fc8194b2e483d7b1f7c81918dbec6b" + ], + "index": "pypi", + "version": "==2.28.0" + }, + "six": { + "hashes": [ + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + ], + "index": "pypi", + "version": "==1.16.0" + }, + "tqdm": { + "hashes": [ + "sha256:40be55d30e200777a307a7585aee69e4eabb46b4ec6a4b4a5f2d9f11e7d5408d", + "sha256:74a2cdefe14d11442cedf3ba4e21a3b84ff9a2dbdc6cfae2c34addb2a14a5ea6" + ], + "index": "pypi", + "version": "==4.64.0" + }, + "unidecode": { + "hashes": [ + "sha256:8e4352fb93d5a735c788110d2e7ac8e8031eb06ccbfe8d324ab71735015f9342", + "sha256:afa04efcdd818a93237574791be9b2817d7077c25a068b00f8cff7baa4e59257" + ], + "index": "pypi", + "version": "==1.3.4" + }, + "urllib3": { + "hashes": [ + "sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14", + "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e" + ], + "index": "pypi", + "version": "==1.26.9" + } + }, + "develop": {} +} diff --git a/README.rst b/README.rst index f4c02ea..10fa130 100644 --- a/README.rst +++ b/README.rst @@ -23,32 +23,32 @@ may change and after a new version a full corpus download may be required. Installation instructions ------------------------- -This program requires Python 3.4+. - -Make a virtual environment: - -``$ virtualenv allofplos`` +This program requires Python 3.8+. Using pip: -``(allofplos)$ pip install allofplos`` +``$ pip install allofplos`` This should install *allofplos* and requirements. At this stage you are ready to go. If you want to manually install from source (for example for development purposes), first clone the project repository: -``(allofplos)$ git clone git@github.com:PLOS/allofplos.git`` +``$ git clone git@github.com:PLOS/allofplos.git`` Install Python dependencies inside the newly created virtual environment: -``(allofplos)$ pip install -r requirements.txt`` +``$ pipenv install`` How to run the program ---------------------- Execute the following command. -``(allofplos)$ python -m allofplos.update`` +``$ python -m allofplos.update`` + +or, if running from source: + +``$ pipenv run python -m allofplos.update`` The first time it runs it will download a >4.4 Gb zip file (**allofplos_xml.zip**) with all the XML files inside. @@ -97,13 +97,7 @@ To run the tests, you will need to install *allofplos* with its testing dependencies. These testing dependencies include ``pytest``, which we will use to run the tests. -To get all of the *allofplos* testing dependencies run: - -``(allofplos)$ pip install -U allofplos[test]`` - -Then when you run: - -``(allofplos)$ pytest --pyargs allofplos`` +``$ pipenv run python -m pytest`` It should return something like this: diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 3486390..0000000 --- a/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -certifi==2021.10.8 -chardet==3.0.4 -charset-normalizer==2.0.9 -idna==3.3 -lxml==4.6.5 -peewee==3.5.2 -python-utils==2.2.0 -requests==2.26.0 -six==1.11.0 -tqdm==4.17.1 -unidecode==0.04.21 -urllib3==1.26.7