diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd09899b96d..cb541c562b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: - name: Get full python version id: full-python-version run: | - echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info[:3]))") + echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") - name: Install and set up Poetry run: | python get-poetry.py --preview -y @@ -69,7 +69,7 @@ jobs: - name: Get full python version id: full-python-version run: | - echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info[:3]))") + echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") - name: Install and set up Poetry run: | python get-poetry.py --preview -y @@ -87,7 +87,7 @@ jobs: - name: Test run: | source $HOME/.poetry/env - poetry run pytest -q tests + .venv/bin/pytest -q tests Windows: needs: Linting @@ -106,7 +106,7 @@ jobs: id: full-python-version shell: bash run: | - echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info[:3]))") + echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") - name: Install and setup Poetry run: | python get-poetry.py --preview -y diff --git a/CHANGELOG.md b/CHANGELOG.md index 225ad1590eb..e70d1c8effd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Change Log +## [1.0.3] - 2020-01-31 + +### Fixed + +- Fixed an error which caused the configuration environment variables (like `POETRY_HTTP_BASIC_XXX_PASSWORD`) to not be used ([#1909](https://github.com/python-poetry/poetry/pull/1909)). +- Fixed an error where the `--help` option was not working ([#1910](https://github.com/python-poetry/poetry/pull/1910)). +- Fixed an error where packages from private indices were not decompressed properly ([#1851](https://github.com/python-poetry/poetry/pull/1851)). +- Fixed an error where the version of some PEP-508-formatted wheel dependencies was not properly retrieved ([#1932](https://github.com/python-poetry/poetry/pull/1932)). +- Fixed internal regexps to avoid potential catastrophic backtracking errors ([#1913](https://github.com/python-poetry/poetry/pull/1913)). +- Fixed performance issues when custom indices were defined in the `pyproject.toml` file ([#1892](https://github.com/python-poetry/poetry/pull/1892)). +- Fixed the `get_requires_for_build_wheel()` function of `masonry.api` which wasn't returning the proper result ([#1875](https://github.com/python-poetry/poetry/pull/1875)). + + ## [1.0.2] - 2020-01-10 ### Fixed @@ -783,7 +796,8 @@ Initial release -[Unreleased]: https://github.com/python-poetry/poetry/compare/1.0.2...master +[Unreleased]: https://github.com/python-poetry/poetry/compare/1.0.3...master +[1.0.3]: https://github.com/python-poetry/poetry/releases/tag/1.0.3 [1.0.2]: https://github.com/python-poetry/poetry/releases/tag/1.0.2 [1.0.1]: https://github.com/python-poetry/poetry/releases/tag/1.0.1 [1.0.0]: https://github.com/python-poetry/poetry/releases/tag/1.0.0 diff --git a/README.md b/README.md index cf8317294a2..7bea3955c96 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ to `self update`. poetry self update 1.0.0 ``` -!!!note +*Note:* If you are still on poetry version < 1.0 use `poetry self:update` instead. diff --git a/docs/docs/cli.md b/docs/docs/cli.md index 611a8ed4475..89d19a8cc18 100644 --- a/docs/docs/cli.md +++ b/docs/docs/cli.md @@ -305,7 +305,7 @@ Note that, at the moment, only pure python wheels are supported. ### Options -* `--format (-F)`: Limit the format to either wheel or sdist. +* `--format (-f)`: Limit the format to either `wheel` or `sdist`. ## publish diff --git a/poetry.lock b/poetry.lock index 182f389363d..8cc55799405 100644 --- a/poetry.lock +++ b/poetry.lock @@ -207,7 +207,7 @@ testing = ["pytest (>=3.5,<3.7.3 || >3.7.3)", "pytest-checkdocs (>=1.2)", "pytes [[package]] category = "main" description = "Backports and enhancements for the contextlib module" -marker = "python_version < \"3\"" +marker = "python_version < \"3.4\"" name = "contextlib2" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -227,7 +227,7 @@ description = "Code coverage measurement for Python" name = "coverage" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" -version = "5.0.2" +version = "5.0.3" [package.extras] toml = ["toml"] @@ -363,7 +363,7 @@ description = "File identification library for Python" name = "identify" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" -version = "1.4.9" +version = "1.4.11" [package.extras] license = ["editdistance"] @@ -453,6 +453,21 @@ MarkupSafe = ">=0.23" [package.extras] i18n = ["Babel (>=0.8)"] +[[package]] +category = "dev" +description = "A very fast and expressive template engine." +marker = "python_version >= \"2.7.9\" and python_version < \"2.8.0\" or python_version >= \"3.4\" and python_version < \"4.0\"" +name = "jinja2" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "2.11.1" + +[package.dependencies] +MarkupSafe = ">=0.23" + +[package.extras] +i18n = ["Babel (>=0.8)"] + [[package]] category = "main" description = "An implementation of JSON Schema validation for Python" @@ -623,9 +638,9 @@ docs = ["sphinx"] test = ["pytest", "pytest-cov"] [[package]] -category = "main" +category = "dev" description = "More routines for operating on iterables, beyond itertools" -marker = "python_version < \"3.8\"" +marker = "python_version <= \"2.7\"" name = "more-itertools" optional = false python-versions = "*" @@ -635,22 +650,22 @@ version = "5.0.0" six = ">=1.0.0,<2.0.0" [[package]] -category = "main" +category = "dev" description = "More routines for operating on iterables, beyond itertools" -marker = "python_version < \"3.8\" or python_version > \"2.7\"" +marker = "python_version > \"2.7\"" name = "more-itertools" optional = false python-versions = ">=3.4" version = "7.2.0" [[package]] -category = "main" +category = "dev" description = "More routines for operating on iterables, beyond itertools" -marker = "python_version >= \"3.5\" and python_version < \"3.8\" or python_version < \"3.8\" or python_version > \"2.7\"" +marker = "python_version > \"2.7\"" name = "more-itertools" optional = false python-versions = ">=3.5" -version = "8.0.2" +version = "8.2.0" [[package]] category = "main" @@ -674,7 +689,7 @@ description = "Core utilities for Python packages" name = "packaging" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "20.0" +version = "20.1" [package.dependencies] pyparsing = ">=2.0.2" @@ -727,7 +742,7 @@ description = "Pexpect allows easy control of interactive console applications." name = "pexpect" optional = false python-versions = "*" -version = "4.7.0" +version = "4.8.0" [package.dependencies] ptyprocess = ">=0.5" @@ -1139,8 +1154,8 @@ category = "main" description = "Python 2 and 3 compatibility utilities" name = "six" optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*" -version = "1.13.0" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +version = "1.14.0" [[package]] category = "main" @@ -1260,7 +1275,7 @@ marker = "python_version >= \"3.6\" and python_version < \"4.0\"" name = "typed-ast" optional = false python-versions = "*" -version = "1.4.0" +version = "1.4.1" [[package]] category = "main" @@ -1288,8 +1303,8 @@ category = "main" description = "HTTP library with thread-safe connection pooling, file post, and more." name = "urllib3" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4" -version = "1.25.7" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" +version = "1.25.8" [package.extras] brotli = ["brotlipy (>=0.6.0)"] @@ -1331,14 +1346,16 @@ marker = "python_version >= \"3.5\" and python_version < \"3.8\" or python_versi name = "zipp" optional = false python-versions = ">=2.7" -version = "0.6.0" +version = "1.1.0" [package.dependencies] -more-itertools = "*" +[package.dependencies.contextlib2] +python = "<3.4" +version = "*" [package.extras] docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] -testing = ["pathlib2", "contextlib2", "unittest2"] +testing = ["pathlib2", "unittest2", "jaraco.itertools"] [metadata] content-hash = "e0b632d8363fdf9f70d93901ff537714611bfc31705a897f6d2fb3bc010bca0a" @@ -1479,37 +1496,37 @@ coverage = [ {file = "coverage-4.5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:23cc09ed395b03424d1ae30dcc292615c1372bfba7141eb85e11e50efaa6b351"}, {file = "coverage-4.5.4-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:141f08ed3c4b1847015e2cd62ec06d35e67a3ac185c26f7635f4406b90afa9c5"}, {file = "coverage-4.5.4.tar.gz", hash = "sha256:e07d9f1a23e9e93ab5c62902833bf3e4b1f65502927379148b6622686223125c"}, - {file = "coverage-5.0.2-cp27-cp27m-macosx_10_12_x86_64.whl", hash = "sha256:511ec0c00840e12fb4e852e4db58fa6a01ca4da72f36a9766fae344c3d502033"}, - {file = "coverage-5.0.2-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:d22b4297e7e4225ccf01f1aa55e7a96412ea0796b532dd614c3fcbafa341128e"}, - {file = "coverage-5.0.2-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:593853aa1ac6dcc6405324d877544c596c9d948ef20d2e9512a0f5d2d3202356"}, - {file = "coverage-5.0.2-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:e65a5aa1670db6263f19fdc03daee1d7dbbadb5cb67fd0a1f16033659db13c1d"}, - {file = "coverage-5.0.2-cp27-cp27m-win32.whl", hash = "sha256:d4a2b578a7a70e0c71f662705262f87a456f1e6c1e40ada7ea699abaf070a76d"}, - {file = "coverage-5.0.2-cp27-cp27m-win_amd64.whl", hash = "sha256:28f7f73b34a05e23758e860a89a7f649b85c6749e252eff60ebb05532d180e86"}, - {file = "coverage-5.0.2-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:7d1cc7acc9ce55179616cf72154f9e648136ea55987edf84addbcd9886ffeba2"}, - {file = "coverage-5.0.2-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:2d0cb9b1fe6ad0d915d45ad3d87f03a38e979093a98597e755930db1f897afae"}, - {file = "coverage-5.0.2-cp35-cp35m-macosx_10_12_x86_64.whl", hash = "sha256:bfe102659e2ec13b86c7f3b1db6c9a4e7beea4255058d006351339e6b342d5d2"}, - {file = "coverage-5.0.2-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:23688ff75adfa8bfa2a67254d889f9bdf9302c27241d746e17547c42c732d3f4"}, - {file = "coverage-5.0.2-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:1bf7ba2af1d373a1750888724f84cffdfc697738f29a353c98195f98fc011509"}, - {file = "coverage-5.0.2-cp35-cp35m-win32.whl", hash = "sha256:569f9ee3025682afda6e9b0f5bb14897c0db03f1a1dc088b083dd36e743f92bb"}, - {file = "coverage-5.0.2-cp35-cp35m-win_amd64.whl", hash = "sha256:cf908840896f7aa62d0ec693beb53264b154f972eb8226fb864ac38975590c4f"}, - {file = "coverage-5.0.2-cp36-cp36m-macosx_10_13_x86_64.whl", hash = "sha256:eaad65bd20955131bcdb3967a4dea66b4e4d4ca488efed7c00d91ee0173387e8"}, - {file = "coverage-5.0.2-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:225e79a5d485bc1642cb7ba02281419c633c216cdc6b26c26494ba959f09e69f"}, - {file = "coverage-5.0.2-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:bd82b684bb498c60ef47bb1541a50e6d006dde8579934dcbdbc61d67d1ea70d9"}, - {file = "coverage-5.0.2-cp36-cp36m-win32.whl", hash = "sha256:7ca3db38a61f3655a2613ee2c190d63639215a7a736d3c64cc7bbdb002ce6310"}, - {file = "coverage-5.0.2-cp36-cp36m-win_amd64.whl", hash = "sha256:47874b4711c5aeb295c31b228a758ce3d096be83dc37bd56da48ed99efb8813b"}, - {file = "coverage-5.0.2-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:955ec084f549128fa2702f0b2dc696392001d986b71acd8fd47424f28289a9c3"}, - {file = "coverage-5.0.2-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:1f4ee8e2e4243971618bc16fcc4478317405205f135e95226c2496e2a3b8dbbf"}, - {file = "coverage-5.0.2-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:f45fba420b94165c17896861bb0e8b27fb7abdcedfeb154895d8553df90b7b00"}, - {file = "coverage-5.0.2-cp37-cp37m-win32.whl", hash = "sha256:cca38ded59105f7705ef6ffe1e960b8db6c7d8279c1e71654a4775ab4454ca15"}, - {file = "coverage-5.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:cb2b74c123f65e8166f7e1265829a6c8ed755c3cd16d7f50e75a83456a5f3fd7"}, - {file = "coverage-5.0.2-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:53e7438fef0c97bc248f88ba1edd10268cd94d5609970aaf87abbe493691af87"}, - {file = "coverage-5.0.2-cp38-cp38-manylinux1_i686.whl", hash = "sha256:c1e4e39e43057396a5e9d069bfbb6ffeee892e40c5d2effbd8cd71f34ee66c4d"}, - {file = "coverage-5.0.2-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:5b0a07158360d22492f9abd02a0f2ee7981b33f0646bf796598b7673f6bbab14"}, - {file = "coverage-5.0.2-cp38-cp38m-win32.whl", hash = "sha256:88b51153657612aea68fa684a5b88037597925260392b7bb4509d4f9b0bdd889"}, - {file = "coverage-5.0.2-cp38-cp38m-win_amd64.whl", hash = "sha256:189aac76d6e0d7af15572c51892e7326ee451c076c5a50a9d266406cd6c49708"}, - {file = "coverage-5.0.2-cp39-cp39m-win32.whl", hash = "sha256:d095a7b473f8a95f7efe821f92058c8a2ecfb18f8db6677ae3819e15dc11aaae"}, - {file = "coverage-5.0.2-cp39-cp39m-win_amd64.whl", hash = "sha256:ddeb42a3d5419434742bf4cc71c9eaa22df3b76808e23a82bd0b0bd360f1a9f1"}, - {file = "coverage-5.0.2.tar.gz", hash = "sha256:b251c7092cbb6d789d62dc9c9e7c4fb448c9138b51285c36aeb72462cad3600e"}, + {file = "coverage-5.0.3-cp27-cp27m-macosx_10_12_x86_64.whl", hash = "sha256:cc1109f54a14d940b8512ee9f1c3975c181bbb200306c6d8b87d93376538782f"}, + {file = "coverage-5.0.3-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:be18f4ae5a9e46edae3f329de2191747966a34a3d93046dbdf897319923923bc"}, + {file = "coverage-5.0.3-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:3230d1003eec018ad4a472d254991e34241e0bbd513e97a29727c7c2f637bd2a"}, + {file = "coverage-5.0.3-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:e69215621707119c6baf99bda014a45b999d37602cb7043d943c76a59b05bf52"}, + {file = "coverage-5.0.3-cp27-cp27m-win32.whl", hash = "sha256:1daa3eceed220f9fdb80d5ff950dd95112cd27f70d004c7918ca6dfc6c47054c"}, + {file = "coverage-5.0.3-cp27-cp27m-win_amd64.whl", hash = "sha256:51bc7710b13a2ae0c726f69756cf7ffd4362f4ac36546e243136187cfcc8aa73"}, + {file = "coverage-5.0.3-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:9bea19ac2f08672636350f203db89382121c9c2ade85d945953ef3c8cf9d2a68"}, + {file = "coverage-5.0.3-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:5012d3b8d5a500834783689a5d2292fe06ec75dc86ee1ccdad04b6f5bf231691"}, + {file = "coverage-5.0.3-cp35-cp35m-macosx_10_12_x86_64.whl", hash = "sha256:d513cc3db248e566e07a0da99c230aca3556d9b09ed02f420664e2da97eac301"}, + {file = "coverage-5.0.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:3dbb72eaeea5763676a1a1efd9b427a048c97c39ed92e13336e726117d0b72bf"}, + {file = "coverage-5.0.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:15cf13a6896048d6d947bf7d222f36e4809ab926894beb748fc9caa14605d9c3"}, + {file = "coverage-5.0.3-cp35-cp35m-win32.whl", hash = "sha256:fca1669d464f0c9831fd10be2eef6b86f5ebd76c724d1e0706ebdff86bb4adf0"}, + {file = "coverage-5.0.3-cp35-cp35m-win_amd64.whl", hash = "sha256:1e44a022500d944d42f94df76727ba3fc0a5c0b672c358b61067abb88caee7a0"}, + {file = "coverage-5.0.3-cp36-cp36m-macosx_10_13_x86_64.whl", hash = "sha256:b26aaf69713e5674efbde4d728fb7124e429c9466aeaf5f4a7e9e699b12c9fe2"}, + {file = "coverage-5.0.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:722e4557c8039aad9592c6a4213db75da08c2cd9945320220634f637251c3894"}, + {file = "coverage-5.0.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:7afad9835e7a651d3551eab18cbc0fdb888f0a6136169fbef0662d9cdc9987cf"}, + {file = "coverage-5.0.3-cp36-cp36m-win32.whl", hash = "sha256:25dbf1110d70bab68a74b4b9d74f30e99b177cde3388e07cc7272f2168bd1477"}, + {file = "coverage-5.0.3-cp36-cp36m-win_amd64.whl", hash = "sha256:c312e57847db2526bc92b9bfa78266bfbaabac3fdcd751df4d062cd4c23e46dc"}, + {file = "coverage-5.0.3-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:a8b8ac7876bc3598e43e2603f772d2353d9931709345ad6c1149009fd1bc81b8"}, + {file = "coverage-5.0.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:527b4f316e6bf7755082a783726da20671a0cc388b786a64417780b90565b987"}, + {file = "coverage-5.0.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:d649dc0bcace6fcdb446ae02b98798a856593b19b637c1b9af8edadf2b150bea"}, + {file = "coverage-5.0.3-cp37-cp37m-win32.whl", hash = "sha256:cd60f507c125ac0ad83f05803063bed27e50fa903b9c2cfee3f8a6867ca600fc"}, + {file = "coverage-5.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:c60097190fe9dc2b329a0eb03393e2e0829156a589bd732e70794c0dd804258e"}, + {file = "coverage-5.0.3-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:d7008a6796095a79544f4da1ee49418901961c97ca9e9d44904205ff7d6aa8cb"}, + {file = "coverage-5.0.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:ea9525e0fef2de9208250d6c5aeeee0138921057cd67fcef90fbed49c4d62d37"}, + {file = "coverage-5.0.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:c62a2143e1313944bf4a5ab34fd3b4be15367a02e9478b0ce800cb510e3bbb9d"}, + {file = "coverage-5.0.3-cp38-cp38m-win32.whl", hash = "sha256:b0840b45187699affd4c6588286d429cd79a99d509fe3de0f209594669bb0954"}, + {file = "coverage-5.0.3-cp38-cp38m-win_amd64.whl", hash = "sha256:76e2057e8ffba5472fd28a3a010431fd9e928885ff480cb278877c6e9943cc2e"}, + {file = "coverage-5.0.3-cp39-cp39m-win32.whl", hash = "sha256:b63dd43f455ba878e5e9f80ba4f748c0a2156dde6e0e6e690310e24d6e8caf40"}, + {file = "coverage-5.0.3-cp39-cp39m-win_amd64.whl", hash = "sha256:da93027835164b8223e8e5af2cf902a4c80ed93cb0909417234f4a9df3bcd9af"}, + {file = "coverage-5.0.3.tar.gz", hash = "sha256:77afca04240c40450c331fa796b3eab6f1e15c5ecf8bf2b8bee9706cd5452fef"}, ] cryptography = [ {file = "cryptography-2.8-cp27-cp27m-macosx_10_6_intel.whl", hash = "sha256:fb81c17e0ebe3358486cd8cc3ad78adbae58af12fc2bf2bc0bb84e8090fa5ce8"}, @@ -1571,8 +1588,8 @@ httpretty = [ {file = "httpretty-0.9.7.tar.gz", hash = "sha256:66216f26b9d2c52e81808f3e674a6fb65d4bf719721394a1a9be926177e55fbe"}, ] identify = [ - {file = "identify-1.4.9-py2.py3-none-any.whl", hash = "sha256:72e9c4ed3bc713c7045b762b0d2e2115c572b85abfc1f4604f5a4fd4c6642b71"}, - {file = "identify-1.4.9.tar.gz", hash = "sha256:6f44e637caa40d1b4cb37f6ed3b262ede74901d28b1cc5b1fc07360871edd65d"}, + {file = "identify-1.4.11-py2.py3-none-any.whl", hash = "sha256:1222b648251bdcb8deb240b294f450fbf704c7984e08baa92507e4ea10b436d5"}, + {file = "identify-1.4.11.tar.gz", hash = "sha256:d824ebe21f38325c771c41b08a95a761db1982f1fc0eee37c6c97df3f1636b96"}, ] idna = [ {file = "idna-2.8-py2.py3-none-any.whl", hash = "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c"}, @@ -1597,6 +1614,8 @@ jeepney = [ jinja2 = [ {file = "Jinja2-2.10.3-py2.py3-none-any.whl", hash = "sha256:74320bb91f31270f9551d46522e33af46a80c3d619f4a4bf42b3164d30b5911f"}, {file = "Jinja2-2.10.3.tar.gz", hash = "sha256:9fe95f19286cfefaa917656583d020be14e7859c6b0252588391e47db34527de"}, + {file = "Jinja2-2.11.1-py2.py3-none-any.whl", hash = "sha256:b0eaf100007721b5c16c1fc1eecb87409464edc10469ddc9a22a27a99123be49"}, + {file = "Jinja2-2.11.1.tar.gz", hash = "sha256:93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250"}, ] jsonschema = [ {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"}, @@ -1669,8 +1688,8 @@ more-itertools = [ {file = "more_itertools-5.0.0-py3-none-any.whl", hash = "sha256:fe7a7cae1ccb57d33952113ff4fa1bc5f879963600ed74918f1236e212ee50b9"}, {file = "more-itertools-7.2.0.tar.gz", hash = "sha256:409cd48d4db7052af495b09dec721011634af3753ae1ef92d2b32f73a745f832"}, {file = "more_itertools-7.2.0-py3-none-any.whl", hash = "sha256:92b8c4b06dac4f0611c0729b2f2ede52b2e1bac1ab48f089c7ddc12e26bb60c4"}, - {file = "more-itertools-8.0.2.tar.gz", hash = "sha256:b84b238cce0d9adad5ed87e745778d20a3f8487d0f0cb8b8a586816c7496458d"}, - {file = "more_itertools-8.0.2-py3-none-any.whl", hash = "sha256:c833ef592a0324bcc6a60e48440da07645063c453880c9477ceb22490aec1564"}, + {file = "more-itertools-8.2.0.tar.gz", hash = "sha256:b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507"}, + {file = "more_itertools-8.2.0-py3-none-any.whl", hash = "sha256:5dd8bcf33e5f9513ffa06d5ad33d78f31e1931ac9a18f33d37e77a180d393a7c"}, ] msgpack = [ {file = "msgpack-0.6.2-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:774f5edc3475917cd95fe593e625d23d8580f9b48b570d8853d06cac171cd170"}, @@ -1699,8 +1718,8 @@ nodeenv = [ {file = "nodeenv-1.3.4-py2.py3-none-any.whl", hash = "sha256:561057acd4ae3809e665a9aaaf214afff110bbb6a6d5c8a96121aea6878408b3"}, ] packaging = [ - {file = "packaging-20.0-py2.py3-none-any.whl", hash = "sha256:aec3fdbb8bc9e4bb65f0634b9f551ced63983a529d6a8931817d52fdd0816ddb"}, - {file = "packaging-20.0.tar.gz", hash = "sha256:fe1d8331dfa7cc0a883b49d75fc76380b2ab2734b220fbb87d774e4fd4b851f8"}, + {file = "packaging-20.1-py2.py3-none-any.whl", hash = "sha256:170748228214b70b672c581a3dd610ee51f733018650740e98c7df862a583f73"}, + {file = "packaging-20.1.tar.gz", hash = "sha256:e665345f9eef0c621aa0bf2f8d78cf6d21904eef16a93f020240b704a57f1334"}, ] pastel = [ {file = "pastel-0.1.1-py2.py3-none-any.whl", hash = "sha256:a904e1659512cc9880a028f66de77cc813a4c32f7ceb68725cbc8afad57ef7ef"}, @@ -1719,8 +1738,8 @@ pep562 = [ {file = "pep562-1.0.tar.gz", hash = "sha256:58cb1cc9ee63d93e62b4905a50357618d526d289919814bea1f0da8f53b79395"}, ] pexpect = [ - {file = "pexpect-4.7.0-py2.py3-none-any.whl", hash = "sha256:2094eefdfcf37a1fdbfb9aa090862c1a4878e5c7e0e7e7088bdb511c558e5cd1"}, - {file = "pexpect-4.7.0.tar.gz", hash = "sha256:9e2c1fd0e6ee3a49b28f95d4b33bc389c89b20af6a1255906e90ff1262ce62eb"}, + {file = "pexpect-4.8.0-py2.py3-none-any.whl", hash = "sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937"}, + {file = "pexpect-4.8.0.tar.gz", hash = "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"}, ] pkginfo = [ {file = "pkginfo-1.5.0.1-py2.py3-none-any.whl", hash = "sha256:a6d9e40ca61ad3ebd0b72fbadd4fba16e4c0e4df0428c041e01e06eb6ee71f32"}, @@ -1874,8 +1893,8 @@ shellingham = [ {file = "shellingham-1.3.1.tar.gz", hash = "sha256:985b23bbd1feae47ca6a6365eacd314d93d95a8a16f8f346945074c28fe6f3e0"}, ] six = [ - {file = "six-1.13.0-py2.py3-none-any.whl", hash = "sha256:1f1b7d42e254082a9db6279deae68afb421ceba6158efa6131de7b3003ee93fd"}, - {file = "six-1.13.0.tar.gz", hash = "sha256:30f610279e8b2578cab6db20741130331735c781b56053c59c4076da27f06b66"}, + {file = "six-1.14.0-py2.py3-none-any.whl", hash = "sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"}, + {file = "six-1.14.0.tar.gz", hash = "sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a"}, ] subprocess32 = [ {file = "subprocess32-3.5.4-cp27-cp27m-macosx_10_6_intel.whl", hash = "sha256:88e37c1aac5388df41cc8a8456bb49ebffd321a3ad4d70358e3518176de3a56b"}, @@ -1916,26 +1935,27 @@ tox = [ {file = "tox-3.14.3.tar.gz", hash = "sha256:06ba73b149bf838d5cd25dc30c2dd2671ae5b2757cf98e5c41a35fe449f131b3"}, ] typed-ast = [ - {file = "typed_ast-1.4.0-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:262c247a82d005e43b5b7f69aff746370538e176131c32dda9cb0f324d27141e"}, - {file = "typed_ast-1.4.0-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:71211d26ffd12d63a83e079ff258ac9d56a1376a25bc80b1cdcdf601b855b90b"}, - {file = "typed_ast-1.4.0-cp35-cp35m-win32.whl", hash = "sha256:630968c5cdee51a11c05a30453f8cd65e0cc1d2ad0d9192819df9978984529f4"}, - {file = "typed_ast-1.4.0-cp35-cp35m-win_amd64.whl", hash = "sha256:ffde2fbfad571af120fcbfbbc61c72469e72f550d676c3342492a9dfdefb8f12"}, - {file = "typed_ast-1.4.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:4e0b70c6fc4d010f8107726af5fd37921b666f5b31d9331f0bd24ad9a088e631"}, - {file = "typed_ast-1.4.0-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:bc6c7d3fa1325a0c6613512a093bc2a2a15aeec350451cbdf9e1d4bffe3e3233"}, - {file = "typed_ast-1.4.0-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:cc34a6f5b426748a507dd5d1de4c1978f2eb5626d51326e43280941206c209e1"}, - {file = "typed_ast-1.4.0-cp36-cp36m-win32.whl", hash = "sha256:d896919306dd0aa22d0132f62a1b78d11aaf4c9fc5b3410d3c666b818191630a"}, - {file = "typed_ast-1.4.0-cp36-cp36m-win_amd64.whl", hash = "sha256:354c16e5babd09f5cb0ee000d54cfa38401d8b8891eefa878ac772f827181a3c"}, - {file = "typed_ast-1.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95bd11af7eafc16e829af2d3df510cecfd4387f6453355188342c3e79a2ec87a"}, - {file = "typed_ast-1.4.0-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:18511a0b3e7922276346bcb47e2ef9f38fb90fd31cb9223eed42c85d1312344e"}, - {file = "typed_ast-1.4.0-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:d7c45933b1bdfaf9f36c579671fec15d25b06c8398f113dab64c18ed1adda01d"}, - {file = "typed_ast-1.4.0-cp37-cp37m-win32.whl", hash = "sha256:d755f03c1e4a51e9b24d899561fec4ccaf51f210d52abdf8c07ee2849b212a36"}, - {file = "typed_ast-1.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2b907eb046d049bcd9892e3076c7a6456c93a25bebfe554e931620c90e6a25b0"}, - {file = "typed_ast-1.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:fdc1c9bbf79510b76408840e009ed65958feba92a88833cdceecff93ae8fff66"}, - {file = "typed_ast-1.4.0-cp38-cp38-manylinux1_i686.whl", hash = "sha256:7954560051331d003b4e2b3eb822d9dd2e376fa4f6d98fee32f452f52dd6ebb2"}, - {file = "typed_ast-1.4.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:48e5b1e71f25cfdef98b013263a88d7145879fbb2d5185f2a0c79fa7ebbeae47"}, - {file = "typed_ast-1.4.0-cp38-cp38-win32.whl", hash = "sha256:1170afa46a3799e18b4c977777ce137bb53c7485379d9706af8a59f2ea1aa161"}, - {file = "typed_ast-1.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:838997f4310012cf2e1ad3803bce2f3402e9ffb71ded61b5ee22617b3a7f6b6e"}, - {file = "typed_ast-1.4.0.tar.gz", hash = "sha256:66480f95b8167c9c5c5c87f32cf437d585937970f3fc24386f313a4c97b44e34"}, + {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3"}, + {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb"}, + {file = "typed_ast-1.4.1-cp35-cp35m-win32.whl", hash = "sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919"}, + {file = "typed_ast-1.4.1-cp35-cp35m-win_amd64.whl", hash = "sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01"}, + {file = "typed_ast-1.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75"}, + {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652"}, + {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"}, + {file = "typed_ast-1.4.1-cp36-cp36m-win32.whl", hash = "sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1"}, + {file = "typed_ast-1.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa"}, + {file = "typed_ast-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614"}, + {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41"}, + {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b"}, + {file = "typed_ast-1.4.1-cp37-cp37m-win32.whl", hash = "sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe"}, + {file = "typed_ast-1.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355"}, + {file = "typed_ast-1.4.1-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6"}, + {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907"}, + {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d"}, + {file = "typed_ast-1.4.1-cp38-cp38-win32.whl", hash = "sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c"}, + {file = "typed_ast-1.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4"}, + {file = "typed_ast-1.4.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34"}, + {file = "typed_ast-1.4.1.tar.gz", hash = "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b"}, ] typing = [ {file = "typing-3.7.4.1-py2-none-any.whl", hash = "sha256:c8cabb5ab8945cd2f54917be357d134db9cc1eb039e59d1606dc1e60cb1d9d36"}, @@ -1945,8 +1965,8 @@ typing = [ urllib3 = [ {file = "urllib3-1.24.3-py2.py3-none-any.whl", hash = "sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb"}, {file = "urllib3-1.24.3.tar.gz", hash = "sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4"}, - {file = "urllib3-1.25.7-py2.py3-none-any.whl", hash = "sha256:a8a318824cc77d1fd4b2bec2ded92646630d7fe8619497b142c84a9e6f5a7293"}, - {file = "urllib3-1.25.7.tar.gz", hash = "sha256:f3c5fd51747d450d4dcf6f923c81f78f811aab8205fda64b0aba34a4e48b0745"}, + {file = "urllib3-1.25.8-py2.py3-none-any.whl", hash = "sha256:2f3db8b19923a873b3e5256dc9c2dedfa883e33d87c690d9c7913e1f40673cdc"}, + {file = "urllib3-1.25.8.tar.gz", hash = "sha256:87716c2d2a7121198ebcb7ce7cccf6ce5e9ba539041cfbaeecfb641dc0bf6acc"}, ] virtualenv = [ {file = "virtualenv-16.7.9-py2.py3-none-any.whl", hash = "sha256:55059a7a676e4e19498f1aad09b8313a38fcc0cdbe4fdddc0e9b06946d21b4bb"}, @@ -1961,6 +1981,6 @@ webencodings = [ {file = "webencodings-0.5.1.tar.gz", hash = "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"}, ] zipp = [ - {file = "zipp-0.6.0-py2.py3-none-any.whl", hash = "sha256:f06903e9f1f43b12d371004b4ac7b06ab39a44adc747266928ae6debfa7b3335"}, - {file = "zipp-0.6.0.tar.gz", hash = "sha256:3718b1cbcd963c7d4c5511a8240812904164b7f381b647143a89d3b98f9bcd8e"}, + {file = "zipp-1.1.0-py2.py3-none-any.whl", hash = "sha256:15428d652e993b6ce86694c3cccf0d71aa7afdc6ef1807fa25a920e9444e0281"}, + {file = "zipp-1.1.0.tar.gz", hash = "sha256:d9d2efe11d3a3fb9184da550d35bd1319dc8e30a63255927c82bb42fca1f4f7c"}, ] diff --git a/poetry/__version__.py b/poetry/__version__.py index 7863915fa5f..976498ab9ca 100644 --- a/poetry/__version__.py +++ b/poetry/__version__.py @@ -1 +1 @@ -__version__ = "1.0.2" +__version__ = "1.0.3" diff --git a/poetry/console/commands/init.py b/poetry/console/commands/init.py index 5813dee6551..40ed33a17f1 100644 --- a/poetry/console/commands/init.py +++ b/poetry/console/commands/init.py @@ -165,8 +165,7 @@ def handle(self): dev_requirements = {} question = ( - "Would you like to define your dev dependencies" - " (require-dev) interactively" + "Would you like to define your development dependencies interactively?" ) if self.confirm(question, True): if not help_displayed: diff --git a/poetry/console/config/application_config.py b/poetry/console/config/application_config.py index 36b72e9969e..97570956b09 100644 --- a/poetry/console/config/application_config.py +++ b/poetry/console/config/application_config.py @@ -9,6 +9,7 @@ from clikit.api.event import PreHandleEvent from clikit.api.event import PreResolveEvent from clikit.api.event.event_dispatcher import EventDispatcher +from clikit.api.exceptions import CliKitException from clikit.api.formatter import Style from clikit.api.io import Input from clikit.api.io import InputStream @@ -101,7 +102,16 @@ def resolve_help_command( if args.has_option_token("-h") or args.has_option_token("--help"): from clikit.api.resolver import ResolvedCommand - resolved_command = self.command_resolver.resolve(args, application) + try: + resolved_command = self.command_resolver.resolve(args, application) + except CliKitException: + # We weren't able to resolve the command, + # due to a parse error most likely, + # so we fall back on the default behavior + return super(ApplicationConfig, self).resolve_help_command( + event, event_name, dispatcher + ) + # If the current command is the run one, skip option # check and interpret them as part of the executed command if resolved_command.command.name == "run": diff --git a/poetry/masonry/api.py b/poetry/masonry/api.py index 539637df8f8..b6df04b0168 100644 --- a/poetry/masonry/api.py +++ b/poetry/masonry/api.py @@ -20,13 +20,14 @@ def get_requires_for_build_wheel(config_settings=None): """ - Returns a list of requirements for building, as strings - """ - poetry = Factory().create_poetry(Path(".")) + Returns an additional list of requirements for building, as PEP508 strings, + above and beyond those specified in the pyproject.toml file. - main, _ = SdistBuilder.convert_dependencies(poetry.package, poetry.package.requires) + This implementation is optional. At the moment it only returns an empty list, which would be the same as if + not define. So this is just for completeness for future implementation. + """ - return main + return [] # For now, we require all dependencies to build either a wheel or an sdist. diff --git a/poetry/packages/__init__.py b/poetry/packages/__init__.py index caa9c1c28a6..e0a2203c9d3 100644 --- a/poetry/packages/__init__.py +++ b/poetry/packages/__init__.py @@ -2,6 +2,7 @@ import re from poetry.semver import Version +from poetry.utils.patterns import wheel_file_re from poetry.version.requirements import Requirement from .dependency import Dependency @@ -70,7 +71,7 @@ def dependency_from_pep_508(name): link = Link(path_to_url(os.path.normpath(os.path.abspath(link.path)))) # wheel file if link.is_wheel: - m = re.match(r"^(?P(?P.+?)-(?P\d.*?))", link.filename) + m = wheel_file_re.match(link.filename) if not m: raise ValueError("Invalid wheel name: {}".format(link.filename)) diff --git a/poetry/utils/inspector.py b/poetry/utils/inspector.py index 767f0946542..f1675273b47 100644 --- a/poetry/utils/inspector.py +++ b/poetry/utils/inspector.py @@ -3,8 +3,6 @@ import tarfile import zipfile -from bz2 import BZ2File -from gzip import GzipFile from typing import Dict from typing import List from typing import Union @@ -114,27 +112,21 @@ def inspect_sdist( # Still not dependencies found # So, we unpack and introspect suffix = file_path.suffix - gz = None if suffix == ".zip": tar = zipfile.ZipFile(str(file_path)) else: if suffix == ".bz2": - gz = BZ2File(str(file_path)) suffixes = file_path.suffixes if len(suffixes) > 1 and suffixes[-2] == ".tar": suffix = ".tar.bz2" else: - gz = GzipFile(str(file_path)) suffix = ".tar.gz" - tar = tarfile.TarFile(str(file_path), fileobj=gz) + tar = tarfile.open(str(file_path)) try: tar.extractall(os.path.join(str(file_path.parent), "unpacked")) finally: - if gz: - gz.close() - tar.close() unpacked = file_path.parent / "unpacked" diff --git a/poetry/utils/password_manager.py b/poetry/utils/password_manager.py index e992b0562e9..24a615a46bf 100644 --- a/poetry/utils/password_manager.py +++ b/poetry/utils/password_manager.py @@ -117,44 +117,52 @@ def _check(self): class PasswordManager: def __init__(self, config): self._config = config - self._keyring = KeyRing("poetry-repository") - if not self._keyring.is_available(): - logger.warning("Using a plaintext file to store and retrieve credentials") + self._keyring = None @property def keyring(self): + if self._keyring is None: + self._keyring = KeyRing("poetry-repository") + if not self._keyring.is_available(): + logger.warning( + "Using a plaintext file to store and retrieve credentials" + ) + return self._keyring def set_pypi_token(self, name, token): - if not self._keyring.is_available(): + if not self.keyring.is_available(): self._config.auth_config_source.add_property( "pypi-token.{}".format(name), token ) else: - self._keyring.set_password(name, "__token__", token) + self.keyring.set_password(name, "__token__", token) def get_pypi_token(self, name): - if not self._keyring.is_available(): + if not self.keyring.is_available(): return self._config.get("pypi-token.{}".format(name)) - return self._keyring.get_password(name, "__token__") + return self.keyring.get_password(name, "__token__") def delete_pypi_token(self, name): - if not self._keyring.is_available(): + if not self.keyring.is_available(): return self._config.auth_config_source.remove_property( "pypi-token.{}".format(name) ) - self._keyring.delete_password(name, "__token__") + self.keyring.delete_password(name, "__token__") def get_http_auth(self, name): auth = self._config.get("http-basic.{}".format(name)) if not auth: - return None - - username, password = auth["username"], auth.get("password") - if password is None: - password = self._keyring.get_password(name, username) + username = self._config.get("http-basic.{}.username".format(name)) + password = self._config.get("http-basic.{}.password".format(name)) + if not username and not password: + return None + else: + username, password = auth["username"], auth.get("password") + if password is None: + password = self.keyring.get_password(name, username) return { "username": username, @@ -164,10 +172,10 @@ def get_http_auth(self, name): def set_http_password(self, name, username, password): auth = {"username": username} - if not self._keyring.is_available(): + if not self.keyring.is_available(): auth["password"] = password else: - self._keyring.set_password(name, username, password) + self.keyring.set_password(name, username, password) self._config.auth_config_source.add_property("http-basic.{}".format(name), auth) @@ -177,7 +185,7 @@ def delete_http_password(self, name): return try: - self._keyring.delete_password(name, auth["username"]) + self.keyring.delete_password(name, auth["username"]) except KeyRingError: pass diff --git a/poetry/vcs/git.py b/poetry/vcs/git.py index 780a687f40b..791e68dd1af 100644 --- a/poetry/vcs/git.py +++ b/poetry/vcs/git.py @@ -7,46 +7,84 @@ from poetry.utils._compat import decode +pattern_formats = { + "protocol": r"\w+", + "user": r"[a-zA-Z0-9_.-]+", + "resource": r"[a-zA-Z0-9_.-]+", + "port": r"\d+", + "path": r"[\w~.\-/\\]+", + "name": r"[\w~.\-]+", + "rev": r"[^@#]+", +} + PATTERNS = [ - re.compile( - r"(git\+)?" - r"((?P\w+)://)" - r"((?P\w+)@)?" - r"(?P[\w.\-]+)" - r"(:(?P\d+))?" - r"(?P(/(?P\w+)/)" - r"((?P([\w\-/]+)/)?(?P[\w\-]+)(\.git|/)?)?)" - r"([@#](?P[^@#]+))?" - r"$" - ), re.compile( r"^(git\+)?" r"(?Phttps?|git|ssh|rsync|file)://" - r"(?:(?P.+)@)*" - r"(?P[a-z0-9_.-]*)" - r"(:?P[\d]+)?" - r"(?P[:/]((?P[\w\-]+)/(?P([\w\-/]+)/)?)?" - r"((?P[\w\-.]+?)(\.git|/)?)?)" - r"([@#](?P[^@#]+))?" - r"$" + r"(?:(?P{user})@)?" + r"(?P{resource})?" + r"(:(?P{port}))?" + r"(?P[:/\\]({path}[/\\])?" + r"((?P{name}?)(\.git|[/\\])?)?)" + r"([@#](?P{rev}))?" + r"$".format( + user=pattern_formats["user"], + resource=pattern_formats["resource"], + port=pattern_formats["port"], + path=pattern_formats["path"], + name=pattern_formats["name"], + rev=pattern_formats["rev"], + ) ), re.compile( - r"^(?:(?P.+)@)*" - r"(?P[a-z0-9_.-]*)[:]*" - r"(?P[\d]+)?" - r"(?P/?(?P.+)/(?P([\w\-/]+)/)?(?P.+).git)" - r"([@#](?P[^@#]+))?" - r"$" + r"(git\+)?" + r"((?P{protocol})://)" + r"(?:(?P{user})@)?" + r"(?P{resource}:?)" + r"(:(?P{port}))?" + r"(?P({path})" + r"(?P{name})(\.git|/)?)" + r"([@#](?P{rev}))?" + r"$".format( + protocol=pattern_formats["protocol"], + user=pattern_formats["user"], + resource=pattern_formats["resource"], + port=pattern_formats["port"], + path=pattern_formats["path"], + name=pattern_formats["name"], + rev=pattern_formats["rev"], + ) ), re.compile( - r"((?P\w+)@)?" - r"(?P[\w.\-]+)" - r"[:/]{1,2}" - r"(?P((?P\w+)/)?" - r"(?P([\w\-/]+)/)?" - r"((?P[\w\-]+)(\.git|/)?)?)" - r"([@#](?P[^@#]+))?" - r"$" + r"^(?:(?P{user})@)?" + r"(?P{resource})" + r"(:(?P{port}))?" + r"(?P([:/]{path}/)" + r"(?P{name})(\.git|/)?)" + r"([@#](?P{rev}))?" + r"$".format( + user=pattern_formats["user"], + resource=pattern_formats["resource"], + port=pattern_formats["port"], + path=pattern_formats["path"], + name=pattern_formats["name"], + rev=pattern_formats["rev"], + ) + ), + re.compile( + r"((?P{user})@)?" + r"(?P{resource})" + r"[:/]{{1,2}}" + r"(?P({path})" + r"(?P{name})(\.git|/)?)" + r"([@#](?P{rev}))?" + r"$".format( + user=pattern_formats["user"], + resource=pattern_formats["resource"], + path=pattern_formats["path"], + name=pattern_formats["name"], + rev=pattern_formats["rev"], + ) ), ] diff --git a/pyproject.toml b/pyproject.toml index 283091dfbc1..13e8199331b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "poetry" -version = "1.0.2" +version = "1.0.3" description = "Python dependency management and packaging made easy." authors = [ "Sébastien Eustace " diff --git a/tests/console/commands/env/test_list.py b/tests/console/commands/env/test_list.py index 1d79b8e57a7..e9112449307 100644 --- a/tests/console/commands/env/test_list.py +++ b/tests/console/commands/env/test_list.py @@ -7,7 +7,9 @@ from poetry.utils.toml_file import TomlFile -def test_none_activated(app, tmp_dir): +def test_none_activated(app, tmp_dir, mocker, env): + mocker.patch("poetry.utils.env.EnvManager.get", return_value=env) + app.poetry.config.merge({"virtualenvs": {"path": str(tmp_dir)}}) venv_name = EnvManager.generate_env_name( diff --git a/tests/console/commands/env/test_use.py b/tests/console/commands/env/test_use.py index 7f848494755..2b1967bf3b1 100644 --- a/tests/console/commands/env/test_use.py +++ b/tests/console/commands/env/test_use.py @@ -37,6 +37,7 @@ def check_output(cmd, *args, **kwargs): def test_activate_activates_non_existing_virtualenv_no_envs_file(app, tmp_dir, mocker): + mocker.stopall() if "VIRTUAL_ENV" in os.environ: del os.environ["VIRTUAL_ENV"] @@ -85,6 +86,7 @@ def test_activate_activates_non_existing_virtualenv_no_envs_file(app, tmp_dir, m def test_get_prefers_explicitly_activated_virtualenvs_over_env_var( app, tmp_dir, mocker ): + mocker.stopall() os.environ["VIRTUAL_ENV"] = "/environment/prefix" venv_name = EnvManager.generate_env_name( @@ -127,6 +129,7 @@ def test_get_prefers_explicitly_activated_virtualenvs_over_env_var( def test_get_prefers_explicitly_activated_non_existing_virtualenvs_over_env_var( app, tmp_dir, mocker ): + mocker.stopall() os.environ["VIRTUAL_ENV"] = "/environment/prefix" venv_name = EnvManager.generate_env_name( diff --git a/tests/console/commands/test_run.py b/tests/console/commands/test_run.py index 45848222841..e8ae40aa606 100644 --- a/tests/console/commands/test_run.py +++ b/tests/console/commands/test_run.py @@ -1,11 +1,7 @@ from cleo.testers import CommandTester -from poetry.utils._compat import Path -from poetry.utils.env import MockEnv - -def test_run_passes_all_args(app, mocker): - env = MockEnv(path=Path("/prefix"), base=Path("/base/prefix"), is_venv=True) +def test_run_passes_all_args(app, mocker, env): mocker.patch("poetry.utils.env.EnvManager.get", return_value=env) command = app.find("run") diff --git a/tests/console/conftest.py b/tests/console/conftest.py index 6750fbbcfdd..58b8834aa61 100644 --- a/tests/console/conftest.py +++ b/tests/console/conftest.py @@ -13,6 +13,7 @@ from poetry.repositories import Repository as BaseRepository from poetry.repositories.exceptions import PackageNotFound from poetry.utils._compat import Path +from poetry.utils.env import MockEnv from poetry.utils.toml_file import TomlFile from tests.helpers import mock_clone from tests.helpers import mock_download @@ -28,8 +29,13 @@ def installed(): return BaseRepository() +@pytest.fixture +def env(): + return MockEnv(path=Path("/prefix"), base=Path("/base/prefix"), is_venv=True) + + @pytest.fixture(autouse=True) -def setup(mocker, installer, installed, config): +def setup(mocker, installer, installed, config, env): # Set Installer's installer p = mocker.patch("poetry.installation.installer.Installer._get_installer") p.return_value = installer @@ -51,6 +57,9 @@ def setup(mocker, installer, installed, config): # Patch download to not download anything but to just copy from fixtures mocker.patch("poetry.utils.inspector.Inspector.download", new=mock_download) + # Patch the virtual environment creation do actually do nothing + mocker.patch("poetry.utils.env.EnvManager.create_venv", return_value=env) + # Setting terminal width environ = dict(os.environ) os.environ["COLUMNS"] = "80" diff --git a/tests/masonry/test_api.py b/tests/masonry/test_api.py index c455d568296..2019a08212a 100644 --- a/tests/masonry/test_api.py +++ b/tests/masonry/test_api.py @@ -28,15 +28,15 @@ def cwd(directory): def test_get_requires_for_build_wheel(): - expected = ["cleo>=0.6.0,<0.7.0", "cachy[msgpack]>=0.2.0,<0.3.0"] + expected = [] with cwd(os.path.join(fixtures, "complete")): - api.get_requires_for_build_wheel() == expected + assert api.get_requires_for_build_wheel() == expected def test_get_requires_for_build_sdist(): - expected = ["cleo>=0.6.0,<0.7.0", "cachy[msgpack]>=0.2.0,<0.3.0"] + expected = [] with cwd(os.path.join(fixtures, "complete")): - api.get_requires_for_build_sdist() == expected + assert api.get_requires_for_build_sdist() == expected def test_build_wheel(): diff --git a/tests/packages/test_main.py b/tests/packages/test_main.py index 7cc93397f0d..586be5a31b8 100644 --- a/tests/packages/test_main.py +++ b/tests/packages/test_main.py @@ -191,3 +191,14 @@ def test_dependency_from_pep_508_with_url(): assert "django-utils" == dep.name assert dep.is_url() assert "https://example.com/django-utils-1.0.0.tar.gz" == dep.url + + +def test_dependency_from_pep_508_with_wheel_url(): + name = ( + "example_wheel @ https://example.com/example_wheel-14.0.2-py2.py3-none-any.whl" + ) + + dep = dependency_from_pep_508(name) + + assert "example-wheel" == dep.name + assert str(dep.constraint) == "14.0.2" diff --git a/tests/utils/test_password_manager.py b/tests/utils/test_password_manager.py index a5f89eb028e..675d38b7bbc 100644 --- a/tests/utils/test_password_manager.py +++ b/tests/utils/test_password_manager.py @@ -1,3 +1,5 @@ +import os + import pytest from keyring.backend import KeyringBackend @@ -208,3 +210,17 @@ def test_keyring_with_chainer_backend_and_not_compatible_only_should_be_unavaila key_ring = KeyRing("poetry") assert not key_ring.is_available() + + +def test_get_http_auth_from_environment_variables( + environ, config, mock_available_backend +): + os.environ["POETRY_HTTP_BASIC_FOO_USERNAME"] = "bar" + os.environ["POETRY_HTTP_BASIC_FOO_PASSWORD"] = "baz" + + manager = PasswordManager(config) + + auth = manager.get_http_auth("foo") + + assert "bar" == auth["username"] + assert "baz" == auth["password"] diff --git a/tests/vcs/test_git.py b/tests/vcs/test_git.py index 667294ee614..062272151fb 100644 --- a/tests/vcs/test_git.py +++ b/tests/vcs/test_git.py @@ -2,6 +2,7 @@ from poetry.vcs.git import Git from poetry.vcs.git import GitUrl +from poetry.vcs.git import ParsedUrl @pytest.mark.parametrize( @@ -19,6 +20,10 @@ "git+https://user@hostname/project/blah.git", GitUrl("https://user@hostname/project/blah.git", None), ), + ( + "git+https://user@hostname/project~_-.foo/blah~_-.bar.git", + GitUrl("https://user@hostname/project~_-.foo/blah~_-.bar.git", None), + ), ( "git+https://user@hostname:project/blah.git", GitUrl("https://user@hostname/project/blah.git", None), @@ -74,3 +79,183 @@ ) def test_normalize_url(url, normalized): assert normalized == Git.normalize_url(url) + + +@pytest.mark.parametrize( + "url, parsed", + [ + ( + "git+ssh://user@hostname:project.git#commit", + ParsedUrl( + "ssh", "hostname", ":project.git", "user", None, "project", "commit" + ), + ), + ( + "git+http://user@hostname/project/blah.git@commit", + ParsedUrl( + "http", "hostname", "/project/blah.git", "user", None, "blah", "commit" + ), + ), + ( + "git+https://user@hostname/project/blah.git", + ParsedUrl( + "https", "hostname", "/project/blah.git", "user", None, "blah", None + ), + ), + ( + "git+https://user@hostname/project~_-.foo/blah~_-.bar.git", + ParsedUrl( + "https", + "hostname", + "/project~_-.foo/blah~_-.bar.git", + "user", + None, + "blah~_-.bar", + None, + ), + ), + ( + "git+https://user@hostname:project/blah.git", + ParsedUrl( + "https", "hostname", ":project/blah.git", "user", None, "blah", None + ), + ), + ( + "git+ssh://git@github.com:sdispater/poetry.git#v1.0.27", + ParsedUrl( + "ssh", + "github.com", + ":sdispater/poetry.git", + "git", + None, + "poetry", + "v1.0.27", + ), + ), + ( + "git+ssh://git@github.com:/sdispater/poetry.git", + ParsedUrl( + "ssh", + "github.com", + ":/sdispater/poetry.git", + "git", + None, + "poetry", + None, + ), + ), + ( + "git+ssh://git@github.com:org/repo", + ParsedUrl("ssh", "github.com", ":org/repo", "git", None, "repo", None), + ), + ( + "git+ssh://git@github.com/org/repo", + ParsedUrl("ssh", "github.com", "/org/repo", "git", None, "repo", None), + ), + ( + "git+ssh://foo:22/some/path", + ParsedUrl("ssh", "foo", "/some/path", None, "22", "path", None), + ), + ( + "git@github.com:org/repo", + ParsedUrl(None, "github.com", ":org/repo", "git", None, "repo", None), + ), + ( + "git+https://github.com/sdispater/pendulum", + ParsedUrl( + "https", + "github.com", + "/sdispater/pendulum", + None, + None, + "pendulum", + None, + ), + ), + ( + "git+https://github.com/sdispater/pendulum#7a018f2d075b03a73409e8356f9b29c9ad4ea2c5", + ParsedUrl( + "https", + "github.com", + "/sdispater/pendulum", + None, + None, + "pendulum", + "7a018f2d075b03a73409e8356f9b29c9ad4ea2c5", + ), + ), + ( + "git+ssh://git@git.example.com:b/b.git#v1.0.0", + ParsedUrl("ssh", "git.example.com", ":b/b.git", "git", None, "b", "v1.0.0"), + ), + ( + "git+ssh://git@github.com:sdispater/pendulum.git#foo/bar", + ParsedUrl( + "ssh", + "github.com", + ":sdispater/pendulum.git", + "git", + None, + "pendulum", + "foo/bar", + ), + ), + ( + "git+file:///foo/bar.git", + ParsedUrl("file", None, "/foo/bar.git", None, None, "bar", None), + ), + ( + "git+file://C:\\Users\\hello\\testing.git#zkat/windows-files", + ParsedUrl( + "file", + "C", + ":\\Users\\hello\\testing.git", + None, + None, + "testing", + "zkat/windows-files", + ), + ), + ( + "git+https://git.example.com/sdispater/project/my_repo.git", + ParsedUrl( + "https", + "git.example.com", + "/sdispater/project/my_repo.git", + None, + None, + "my_repo", + None, + ), + ), + ( + "git+ssh://git@git.example.com:sdispater/project/my_repo.git", + ParsedUrl( + "ssh", + "git.example.com", + ":sdispater/project/my_repo.git", + "git", + None, + "my_repo", + None, + ), + ), + ], +) +def test_parse_url(url, parsed): + result = ParsedUrl.parse(url) + assert parsed.name == result.name + assert parsed.pathname == result.pathname + assert parsed.port == result.port + assert parsed.protocol == result.protocol + assert parsed.resource == result.resource + assert parsed.rev == result.rev + assert parsed.url == result.url + assert parsed.user == result.user + + +def test_parse_url_should_fail(): + url = "https://" + "@" * 64 + "!" + + with pytest.raises(ValueError): + ParsedUrl.parse(url)