diff --git a/src/poetry/packages/locker.py b/src/poetry/packages/locker.py index 5ef821d6988..9d1437bf3d4 100644 --- a/src/poetry/packages/locker.py +++ b/src/poetry/packages/locker.py @@ -47,7 +47,8 @@ class Locker: - _VERSION = "1.2" + _VERSION = "2.0" + _READ_VERSION_RANGE = ">=1,<3" _legacy_keys = ["dependencies", "source", "extras", "dev-dependencies"] _relevant_keys = [*_legacy_keys, "group"] @@ -258,8 +259,6 @@ def set_lock_data(self, root: Package, packages: list[Package]) -> bool: "lock-version": self._VERSION, "python-versions": root.python_versions, "content-hash": self._content_hash, - # TODO stop writing files here, this is deprecated. - "files": files, } if not self.is_locked() or lock != self.lock_data: @@ -307,11 +306,7 @@ def _get_lock_data(self) -> TOMLDocument: metadata = cast("Table", lock_data["metadata"]) lock_version = Version.parse(metadata.get("lock-version", "1.0")) current_version = Version.parse(self._VERSION) - # We expect the locker to be able to read lock files - # from the same semantic versioning range - accepted_versions = parse_constraint( - f"^{Version.from_parts(current_version.major, 0)}" - ) + accepted_versions = parse_constraint(self._READ_VERSION_RANGE) lock_version_allowed = accepted_versions.allows(lock_version) if lock_version_allowed and current_version < lock_version: logger.warning( diff --git a/tests/console/commands/test_lock.py b/tests/console/commands/test_lock.py index 84a997db85f..5d6eb53887e 100644 --- a/tests/console/commands/test_lock.py +++ b/tests/console/commands/test_lock.py @@ -146,7 +146,7 @@ def test_lock_no_update( assert len(packages) == len(locked_repository.packages) - assert locker.lock_data["metadata"].get("lock-version") == "1.2" + assert locker.lock_data["metadata"].get("lock-version") == "2.0" for package in packages: assert locked_repository.find_packages(package.to_dependency()) diff --git a/tests/fixtures/outdated_lock/poetry.lock b/tests/fixtures/outdated_lock/poetry.lock index 9308c921955..51c1e1d1f09 100644 --- a/tests/fixtures/outdated_lock/poetry.lock +++ b/tests/fixtures/outdated_lock/poetry.lock @@ -211,54 +211,6 @@ hash = "sha256:d735b91d6d1692a6a181f2a8c9e0238e5f6373356f561bb9dc4c7af36f452010" six = "*" [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "^3.8" content-hash = "2f47de5e052dabeff3c1362d3a37b5cfcaf9bbe9d9ce1681207e72ca1f4dab55" - -[metadata.files] -certifi = [ - {file = "certifi-2020.6.20-py2.py3-none-any.whl", hash = "sha256:8fc0819f1f30ba15bdb34cceffb9ef04d99f420f68eb75d901e9560b8749fc41"}, - {file = "certifi-2020.6.20.tar.gz", hash = "sha256:5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3"}, -] -chardet = [ - {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, - {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, -] -docker = [ - {file = "docker-4.3.0-py2.py3-none-any.whl", hash = "sha256:ba118607b0ba6bfc1b236ec32019a355c47b5d012d01d976467d4692ef443929"}, - {file = "docker-4.3.0.tar.gz", hash = "sha256:431a268f2caf85aa30613f9642da274c62f6ee8bae7d70d968e01529f7d6af93"}, -] -idna = [ - {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, - {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, -] -pywin32 = [ - {file = "pywin32-227-cp27-cp27m-win32.whl", hash = "sha256:371fcc39416d736401f0274dd64c2302728c9e034808e37381b5e1b22be4a6b0"}, - {file = "pywin32-227-cp27-cp27m-win_amd64.whl", hash = "sha256:4cdad3e84191194ea6d0dd1b1b9bdda574ff563177d2adf2b4efec2a244fa116"}, - {file = "pywin32-227-cp35-cp35m-win32.whl", hash = "sha256:f4c5be1a293bae0076d93c88f37ee8da68136744588bc5e2be2f299a34ceb7aa"}, - {file = "pywin32-227-cp35-cp35m-win_amd64.whl", hash = "sha256:a929a4af626e530383a579431b70e512e736e9588106715215bf685a3ea508d4"}, - {file = "pywin32-227-cp36-cp36m-win32.whl", hash = "sha256:300a2db938e98c3e7e2093e4491439e62287d0d493fe07cce110db070b54c0be"}, - {file = "pywin32-227-cp36-cp36m-win_amd64.whl", hash = "sha256:9b31e009564fb95db160f154e2aa195ed66bcc4c058ed72850d047141b36f3a2"}, - {file = "pywin32-227-cp37-cp37m-win32.whl", hash = "sha256:47a3c7551376a865dd8d095a98deba954a98f326c6fe3c72d8726ca6e6b15507"}, - {file = "pywin32-227-cp37-cp37m-win_amd64.whl", hash = "sha256:31f88a89139cb2adc40f8f0e65ee56a8c585f629974f9e07622ba80199057511"}, - {file = "pywin32-227-cp38-cp38-win32.whl", hash = "sha256:7f18199fbf29ca99dff10e1f09451582ae9e372a892ff03a28528a24d55875bc"}, - {file = "pywin32-227-cp38-cp38-win_amd64.whl", hash = "sha256:7c1ae32c489dc012930787f06244426f8356e129184a02c25aef163917ce158e"}, - {file = "pywin32-227-cp39-cp39-win32.whl", hash = "sha256:c054c52ba46e7eb6b7d7dfae4dbd987a1bb48ee86debe3f245a2884ece46e295"}, - {file = "pywin32-227-cp39-cp39-win_amd64.whl", hash = "sha256:f27cec5e7f588c3d1051651830ecc00294f90728d19c3bf6916e6dba93ea357c"}, -] -requests = [ - {file = "requests-2.24.0-py2.py3-none-any.whl", hash = "sha256:fe75cc94a9443b9246fc7049224f75604b113c36acb93f87b80ed42c44cbb898"}, - {file = "requests-2.24.0.tar.gz", hash = "sha256:b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b"}, -] -six = [ - {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, - {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, -] -urllib3 = [ - {file = "urllib3-1.25.10-py2.py3-none-any.whl", hash = "sha256:e7983572181f5e1522d9c98453462384ee92a0be7fac5f1413a1e35c56cc0461"}, - {file = "urllib3-1.25.10.tar.gz", hash = "sha256:91056c15fa70756691db97756772bb1eb9678fa585d9184f24534b100dc60f4a"}, -] -websocket-client = [ - {file = "websocket_client-0.57.0-py2.py3-none-any.whl", hash = "sha256:0fc45c961324d79c781bab301359d5a1b00b13ad1b10415a4780229ef71a5549"}, - {file = "websocket_client-0.57.0.tar.gz", hash = "sha256:d735b91d6d1692a6a181f2a8c9e0238e5f6373356f561bb9dc4c7af36f452010"}, -] diff --git a/tests/fixtures/up_to_date_lock/poetry.lock b/tests/fixtures/up_to_date_lock/poetry.lock index 6f3931be704..569ab9d4239 100644 --- a/tests/fixtures/up_to_date_lock/poetry.lock +++ b/tests/fixtures/up_to_date_lock/poetry.lock @@ -211,54 +211,6 @@ hash = "sha256:63509b41d158ae5b7f67eb4ad20fecbb4eee99434e73e140354dc3ff8e09716f" six = "*" [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "^3.8" content-hash = "0cd068218f235c162f7b74bc8faf4ce3387b82daee1c1bb7a97af034f27ee116" - -[metadata.files] -certifi = [ - {file = "certifi-2020.12.5-py2.py3-none-any.whl", hash = "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830"}, - {file = "certifi-2020.12.5.tar.gz", hash = "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"}, -] -chardet = [ - {file = "chardet-4.0.0-py2.py3-none-any.whl", hash = "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5"}, - {file = "chardet-4.0.0.tar.gz", hash = "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"}, -] -docker = [ - {file = "docker-4.3.1-py2.py3-none-any.whl", hash = "sha256:13966471e8bc23b36bfb3a6fb4ab75043a5ef1dac86516274777576bed3b9828"}, - {file = "docker-4.3.1.tar.gz", hash = "sha256:bad94b8dd001a8a4af19ce4becc17f41b09f228173ffe6a4e0355389eef142f2"}, -] -idna = [ - {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, - {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, -] -pywin32 = [ - {file = "pywin32-227-cp27-cp27m-win32.whl", hash = "sha256:371fcc39416d736401f0274dd64c2302728c9e034808e37381b5e1b22be4a6b0"}, - {file = "pywin32-227-cp27-cp27m-win_amd64.whl", hash = "sha256:4cdad3e84191194ea6d0dd1b1b9bdda574ff563177d2adf2b4efec2a244fa116"}, - {file = "pywin32-227-cp35-cp35m-win32.whl", hash = "sha256:f4c5be1a293bae0076d93c88f37ee8da68136744588bc5e2be2f299a34ceb7aa"}, - {file = "pywin32-227-cp35-cp35m-win_amd64.whl", hash = "sha256:a929a4af626e530383a579431b70e512e736e9588106715215bf685a3ea508d4"}, - {file = "pywin32-227-cp36-cp36m-win32.whl", hash = "sha256:300a2db938e98c3e7e2093e4491439e62287d0d493fe07cce110db070b54c0be"}, - {file = "pywin32-227-cp36-cp36m-win_amd64.whl", hash = "sha256:9b31e009564fb95db160f154e2aa195ed66bcc4c058ed72850d047141b36f3a2"}, - {file = "pywin32-227-cp37-cp37m-win32.whl", hash = "sha256:47a3c7551376a865dd8d095a98deba954a98f326c6fe3c72d8726ca6e6b15507"}, - {file = "pywin32-227-cp37-cp37m-win_amd64.whl", hash = "sha256:31f88a89139cb2adc40f8f0e65ee56a8c585f629974f9e07622ba80199057511"}, - {file = "pywin32-227-cp38-cp38-win32.whl", hash = "sha256:7f18199fbf29ca99dff10e1f09451582ae9e372a892ff03a28528a24d55875bc"}, - {file = "pywin32-227-cp38-cp38-win_amd64.whl", hash = "sha256:7c1ae32c489dc012930787f06244426f8356e129184a02c25aef163917ce158e"}, - {file = "pywin32-227-cp39-cp39-win32.whl", hash = "sha256:c054c52ba46e7eb6b7d7dfae4dbd987a1bb48ee86debe3f245a2884ece46e295"}, - {file = "pywin32-227-cp39-cp39-win_amd64.whl", hash = "sha256:f27cec5e7f588c3d1051651830ecc00294f90728d19c3bf6916e6dba93ea357c"}, -] -requests = [ - {file = "requests-2.25.1-py2.py3-none-any.whl", hash = "sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e"}, - {file = "requests-2.25.1.tar.gz", hash = "sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"}, -] -six = [ - {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, - {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, -] -urllib3 = [ - {file = "urllib3-1.26.3-py2.py3-none-any.whl", hash = "sha256:1b465e494e3e0d8939b50680403e3aedaa2bc434b7d5af64dfd3c958d7f5ae80"}, - {file = "urllib3-1.26.3.tar.gz", hash = "sha256:de3eedaad74a2683334e282005cd8d7f22f4d55fa690a2a1020a416cb0a47e73"}, -] -websocket-client = [ - {file = "websocket_client-0.58.0-py2.py3-none-any.whl", hash = "sha256:44b5df8f08c74c3d82d28100fdc81f4536809ce98a17f0757557813275fbb663"}, - {file = "websocket_client-0.58.0.tar.gz", hash = "sha256:63509b41d158ae5b7f67eb4ad20fecbb4eee99434e73e140354dc3ff8e09716f"}, -] diff --git a/tests/installation/fixtures/extras-with-dependencies.test b/tests/installation/fixtures/extras-with-dependencies.test index e5c03847040..c4b71a2dd00 100644 --- a/tests/installation/fixtures/extras-with-dependencies.test +++ b/tests/installation/fixtures/extras-with-dependencies.test @@ -42,11 +42,5 @@ foo = ["C"] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -A = [] -B = [] -C = [] -D = [] diff --git a/tests/installation/fixtures/extras.test b/tests/installation/fixtures/extras.test index 52c623dc656..5c33b6e373f 100644 --- a/tests/installation/fixtures/extras.test +++ b/tests/installation/fixtures/extras.test @@ -39,11 +39,5 @@ foo = ["D"] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -A = [] -B = [] -C = [] -D = [] diff --git a/tests/installation/fixtures/install-no-dev.test b/tests/installation/fixtures/install-no-dev.test index 405fafbad67..282c54d578f 100644 --- a/tests/installation/fixtures/install-no-dev.test +++ b/tests/installation/fixtures/install-no-dev.test @@ -27,10 +27,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"A" = [] -"B" = [] -"C" = [] diff --git a/tests/installation/fixtures/no-dependencies.test b/tests/installation/fixtures/no-dependencies.test index 2f9f69be392..374f79aae8a 100644 --- a/tests/installation/fixtures/no-dependencies.test +++ b/tests/installation/fixtures/no-dependencies.test @@ -2,7 +2,5 @@ package = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] diff --git a/tests/installation/fixtures/remove.test b/tests/installation/fixtures/remove.test index dd33cc672af..3a8f1a33159 100644 --- a/tests/installation/fixtures/remove.test +++ b/tests/installation/fixtures/remove.test @@ -9,8 +9,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"A" = [] diff --git a/tests/installation/fixtures/update-with-lock.test b/tests/installation/fixtures/update-with-lock.test index 37b09980bb6..fe6f798f87c 100644 --- a/tests/installation/fixtures/update-with-lock.test +++ b/tests/installation/fixtures/update-with-lock.test @@ -9,8 +9,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"A" = [] diff --git a/tests/installation/fixtures/update-with-locked-extras.test b/tests/installation/fixtures/update-with-locked-extras.test index a95da697644..e748875f102 100644 --- a/tests/installation/fixtures/update-with-locked-extras.test +++ b/tests/installation/fixtures/update-with-locked-extras.test @@ -43,11 +43,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"A" = [] -"B" = [] -"C" = [] -"D" = [] diff --git a/tests/installation/fixtures/with-category-change.test b/tests/installation/fixtures/with-category-change.test index 69222c44c38..66838707b2e 100644 --- a/tests/installation/fixtures/with-category-change.test +++ b/tests/installation/fixtures/with-category-change.test @@ -21,9 +21,5 @@ A = "^1.0" [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"A" = [] -"B" = [] diff --git a/tests/installation/fixtures/with-conditional-dependency.test b/tests/installation/fixtures/with-conditional-dependency.test index 4f733bd424b..3fac6462f9b 100644 --- a/tests/installation/fixtures/with-conditional-dependency.test +++ b/tests/installation/fixtures/with-conditional-dependency.test @@ -24,8 +24,5 @@ python = ">=3.6,<4.0" [metadata] python-versions = "~2.7 || ^3.4" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -A = [] diff --git a/tests/installation/fixtures/with-dependencies-extras.test b/tests/installation/fixtures/with-dependencies-extras.test index 47b0201cce1..0c25d7777f8 100644 --- a/tests/installation/fixtures/with-dependencies-extras.test +++ b/tests/installation/fixtures/with-dependencies-extras.test @@ -33,10 +33,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"A" = [] -"B" = [] -"C" = [] diff --git a/tests/installation/fixtures/with-dependencies-nested-extras.test b/tests/installation/fixtures/with-dependencies-nested-extras.test index 586731bf68e..c6bc9ce396e 100644 --- a/tests/installation/fixtures/with-dependencies-nested-extras.test +++ b/tests/installation/fixtures/with-dependencies-nested-extras.test @@ -39,10 +39,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"A" = [] -"B" = [] -"C" = [] diff --git a/tests/installation/fixtures/with-dependencies.test b/tests/installation/fixtures/with-dependencies.test index 9b21eb02b09..2cc6ee051b3 100644 --- a/tests/installation/fixtures/with-dependencies.test +++ b/tests/installation/fixtures/with-dependencies.test @@ -18,9 +18,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"A" = [] -"B" = [] diff --git a/tests/installation/fixtures/with-directory-dependency-poetry-transitive.test b/tests/installation/fixtures/with-directory-dependency-poetry-transitive.test index 6f7f1b62d3f..be7c6b32f2f 100644 --- a/tests/installation/fixtures/with-directory-dependency-poetry-transitive.test +++ b/tests/installation/fixtures/with-directory-dependency-poetry-transitive.test @@ -100,15 +100,5 @@ url = "project_with_transitive_file_dependencies" [metadata] content-hash = "123456789" -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" - -[metadata.files] -demo = [ - {file = "demo-0.1.0-py2.py3-none-any.whl", hash = "sha256:70e704135718fffbcbf61ed1fc45933cfd86951a744b681000eaaa75da31f17a"}, -] -inner-directory-project = [] -pendulum = [] -project-with-extras = [] -project-with-transitive-directory-dependencies = [] -project-with-transitive-file-dependencies = [] diff --git a/tests/installation/fixtures/with-directory-dependency-poetry.test b/tests/installation/fixtures/with-directory-dependency-poetry.test index d67ebd9d718..c4ab25b6047 100644 --- a/tests/installation/fixtures/with-directory-dependency-poetry.test +++ b/tests/installation/fixtures/with-directory-dependency-poetry.test @@ -30,9 +30,5 @@ url = "tests/fixtures/project_with_extras" [metadata] content-hash = "123456789" -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" - -[metadata.files] -project-with-extras = [] -pendulum = [] diff --git a/tests/installation/fixtures/with-directory-dependency-setuptools.test b/tests/installation/fixtures/with-directory-dependency-setuptools.test index 2563b3a3ccf..c4700222187 100644 --- a/tests/installation/fixtures/with-directory-dependency-setuptools.test +++ b/tests/installation/fixtures/with-directory-dependency-setuptools.test @@ -36,10 +36,5 @@ pendulum = ">=1.4.4" [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -cachy = [] -project-with-setup = [] -pendulum = [] diff --git a/tests/installation/fixtures/with-duplicate-dependencies-update.test b/tests/installation/fixtures/with-duplicate-dependencies-update.test index 341492cf1e6..ed2544695c3 100644 --- a/tests/installation/fixtures/with-duplicate-dependencies-update.test +++ b/tests/installation/fixtures/with-duplicate-dependencies-update.test @@ -33,10 +33,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -A = [] -B = [] -C = [] diff --git a/tests/installation/fixtures/with-duplicate-dependencies.test b/tests/installation/fixtures/with-duplicate-dependencies.test index d4e0fe0feb0..c2b16990725 100644 --- a/tests/installation/fixtures/with-duplicate-dependencies.test +++ b/tests/installation/fixtures/with-duplicate-dependencies.test @@ -57,10 +57,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -A = [] -B = [] -C = [] diff --git a/tests/installation/fixtures/with-file-dependency-transitive.test b/tests/installation/fixtures/with-file-dependency-transitive.test index c032a5f091f..a863af4487a 100644 --- a/tests/installation/fixtures/with-file-dependency-transitive.test +++ b/tests/installation/fixtures/with-file-dependency-transitive.test @@ -64,13 +64,5 @@ url = "project_with_transitive_file_dependencies" [metadata] content-hash = "123456789" -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" - -[metadata.files] -demo = [ - {file = "demo-0.1.0-py2.py3-none-any.whl", hash = "sha256:70e704135718fffbcbf61ed1fc45933cfd86951a744b681000eaaa75da31f17a"}, -] -inner-directory-project = [] -pendulum = [] -project-with-transitive-file-dependencies = [] diff --git a/tests/installation/fixtures/with-file-dependency.test b/tests/installation/fixtures/with-file-dependency.test index 2ad0e06d80f..15b080c0002 100644 --- a/tests/installation/fixtures/with-file-dependency.test +++ b/tests/installation/fixtures/with-file-dependency.test @@ -32,11 +32,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -demo = [ - {file = "demo-0.1.0-py2.py3-none-any.whl", hash = "sha256:70e704135718fffbcbf61ed1fc45933cfd86951a744b681000eaaa75da31f17a"}, -] -pendulum = [] diff --git a/tests/installation/fixtures/with-multiple-updates.test b/tests/installation/fixtures/with-multiple-updates.test index b206f043115..929322c608d 100644 --- a/tests/installation/fixtures/with-multiple-updates.test +++ b/tests/installation/fixtures/with-multiple-updates.test @@ -43,10 +43,5 @@ files = [] [metadata] python-versions = "~2.7 || ^3.4" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -A = [] -B = [] -C = [] diff --git a/tests/installation/fixtures/with-optional-dependencies.test b/tests/installation/fixtures/with-optional-dependencies.test index 37974ffc1a7..f3f6ff16882 100644 --- a/tests/installation/fixtures/with-optional-dependencies.test +++ b/tests/installation/fixtures/with-optional-dependencies.test @@ -33,10 +33,5 @@ foo = ["A"] [metadata] python-versions = "~2.7 || ^3.4" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -A = [] -C = [] -D = [] diff --git a/tests/installation/fixtures/with-platform-dependencies.test b/tests/installation/fixtures/with-platform-dependencies.test index 6048edc2cd9..32ff7af1884 100644 --- a/tests/installation/fixtures/with-platform-dependencies.test +++ b/tests/installation/fixtures/with-platform-dependencies.test @@ -42,11 +42,5 @@ foo = ["A"] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -A = [] -B = [] -C = [] -D = [] diff --git a/tests/installation/fixtures/with-prereleases.test b/tests/installation/fixtures/with-prereleases.test index 902dfb1a683..8c29f0dfb0a 100644 --- a/tests/installation/fixtures/with-prereleases.test +++ b/tests/installation/fixtures/with-prereleases.test @@ -18,9 +18,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"A" = [] -"B" = [] diff --git a/tests/installation/fixtures/with-pypi-repository.test b/tests/installation/fixtures/with-pypi-repository.test index bd8eae34fa2..03444764ee9 100644 --- a/tests/installation/fixtures/with-pypi-repository.test +++ b/tests/installation/fixtures/with-pypi-repository.test @@ -166,43 +166,5 @@ hash = "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -attrs = [ - {file = "attrs-17.4.0-py2.py3-none-any.whl", hash = "sha256:a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450"}, - {file = "attrs-17.4.0.tar.gz", hash = "sha256:1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9"}, -] -colorama = [ - {file = "colorama-0.3.9-py2.py3-none-any.whl", hash = "sha256:463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda"}, - {file = "colorama-0.3.9.tar.gz", hash = "sha256:48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"}, -] -funcsigs = [ - {file = "funcsigs-1.0.2-py2.py3-none-any.whl", hash = "sha256:330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca"}, - {file = "funcsigs-1.0.2.tar.gz", hash = "sha256:a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50"}, -] -more-itertools = [ - {file = "more-itertools-4.1.0.tar.gz", hash = "sha256:c9ce7eccdcb901a2c75d326ea134e0886abfbea5f93e91cc95de9507c0816c44"}, - {file = "more_itertools-4.1.0-py2-none-any.whl", hash = "sha256:11a625025954c20145b37ff6309cd54e39ca94f72f6bb9576d1195db6fa2442e"}, - {file = "more_itertools-4.1.0-py3-none-any.whl", hash = "sha256:0dd8f72eeab0d2c3bd489025bb2f6a1b8342f9b198f6fc37b52d15cfa4531fea"}, -] -pluggy = [ - {file = "pluggy-0.6.0.tar.gz", hash = "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff"}, -] -py = [ - {file = "py-1.5.3-py2.py3-none-any.whl", hash = "sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a"}, - {file = "py-1.5.3.tar.gz", hash = "sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881"}, -] -pytest = [ - {file = "pytest-3.5.0-py2.py3-none-any.whl", hash = "sha256:6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c"}, - {file = "pytest-3.5.0.tar.gz", hash = "sha256:fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1"}, -] -setuptools = [ - {file = "setuptools-39.2.0-py2.py3-none-any.whl", hash = "sha256:8fca9275c89964f13da985c3656cb00ba029d7f3916b37990927ffdf264e7926"}, - {file = "setuptools-39.2.0.zip", hash = "sha256:f7cddbb5f5c640311eb00eab6e849f7701fa70bf6a183fc8a2c33dd1d1672fb2"}, -] -six = [ - {file = "six-1.11.0-py2.py3-none-any.whl", hash = "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"}, - {file = "six-1.11.0.tar.gz", hash = "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"}, -] diff --git a/tests/installation/fixtures/with-python-versions.test b/tests/installation/fixtures/with-python-versions.test index 412a1ff1598..39b18c5132e 100644 --- a/tests/installation/fixtures/with-python-versions.test +++ b/tests/installation/fixtures/with-python-versions.test @@ -27,10 +27,5 @@ files = [] [metadata] python-versions = "~2.7 || ^3.4" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -A = [] -B = [] -C = [] diff --git a/tests/installation/fixtures/with-same-version-url-dependencies.test b/tests/installation/fixtures/with-same-version-url-dependencies.test index c28464c4c6d..e80c72a3d03 100644 --- a/tests/installation/fixtures/with-same-version-url-dependencies.test +++ b/tests/installation/fixtures/with-same-version-url-dependencies.test @@ -49,9 +49,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -demo = [] -pendulum = [] diff --git a/tests/installation/fixtures/with-sub-dependencies.test b/tests/installation/fixtures/with-sub-dependencies.test index 4f16246d6f1..ac967d6fa72 100644 --- a/tests/installation/fixtures/with-sub-dependencies.test +++ b/tests/installation/fixtures/with-sub-dependencies.test @@ -42,11 +42,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -A = [] -B = [] -C = [] -D = [] diff --git a/tests/installation/fixtures/with-url-dependency.test b/tests/installation/fixtures/with-url-dependency.test index ddf9ce6e479..13cab35bc46 100644 --- a/tests/installation/fixtures/with-url-dependency.test +++ b/tests/installation/fixtures/with-url-dependency.test @@ -29,9 +29,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -demo = [] -pendulum = [] diff --git a/tests/installation/fixtures/with-vcs-dependency-with-extras.test b/tests/installation/fixtures/with-vcs-dependency-with-extras.test index 3e7a657988f..12c5da5c941 100644 --- a/tests/installation/fixtures/with-vcs-dependency-with-extras.test +++ b/tests/installation/fixtures/with-vcs-dependency-with-extras.test @@ -41,10 +41,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -demo = [] -pendulum = [] -cleo = [] diff --git a/tests/installation/fixtures/with-vcs-dependency-without-ref.test b/tests/installation/fixtures/with-vcs-dependency-without-ref.test index 8f398146776..67c2c962eb5 100644 --- a/tests/installation/fixtures/with-vcs-dependency-without-ref.test +++ b/tests/installation/fixtures/with-vcs-dependency-without-ref.test @@ -28,9 +28,5 @@ files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -demo = [] -pendulum = [] diff --git a/tests/installation/fixtures/with-wheel-dependency-no-requires-dist.test b/tests/installation/fixtures/with-wheel-dependency-no-requires-dist.test index 267160acf3d..a484b41e8cd 100644 --- a/tests/installation/fixtures/with-wheel-dependency-no-requires-dist.test +++ b/tests/installation/fixtures/with-wheel-dependency-no-requires-dist.test @@ -16,10 +16,5 @@ url = "tests/fixtures/wheel_with_no_requires_dist/demo-0.1.0-py2.py3-none-any.wh [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -demo = [ - {file = "demo-0.1.0-py2.py3-none-any.whl", hash = "sha256:c25eb81459126848a1788eb3520d1a32014eb51ce3d3bae88c56bfdde4ce02db"}, -] diff --git a/tests/packages/test_locker.py b/tests/packages/test_locker.py index d028f355ee6..b0be7e1a528 100644 --- a/tests/packages/test_locker.py +++ b/tests/packages/test_locker.py @@ -197,20 +197,9 @@ def test_lock_file_data_is_ordered(locker: Locker, root: ProjectPackage): url = "https://example.org/url-package-1.0-cp39-win_amd64.whl" [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -A = [ - {{file = "bar", hash = "123"}}, - {{file = "foo", hash = "456"}}, - {{file = "baz", hash = "345"}}, -] -B = [] -git-package = [] -git-package-subdir = [] -url-package = [] """ # noqa: E800 assert content == expected @@ -227,6 +216,7 @@ def test_locker_properly_loads_extras(locker: Locker): category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [] [package.dependencies] msgpack = "*" @@ -241,12 +231,9 @@ def test_locker_properly_loads_extras(locker: Locker): redis = ["redis (>=2.10.5)"] [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "~2.7 || ^3.4" content-hash = "c3d07fca33fba542ef2b2a4d75bf5b48d892d21a830e2ad9c952ba5123a52f77" - -[metadata.files] -cachecontrol = [] """ # noqa: E800 locker.lock.write(tomlkit.parse(content)) @@ -274,6 +261,7 @@ def test_locker_properly_loads_nested_extras(locker: Locker): category = "main" optional = false python-versions = "*" +files = [] [package.dependencies] b = {{version = "^1.0", optional = true, extras = "c"}} @@ -288,6 +276,7 @@ def test_locker_properly_loads_nested_extras(locker: Locker): category = "main" optional = false python-versions = "*" +files = [] [package.dependencies] c = {{version = "^1.0", optional = true}} @@ -302,16 +291,12 @@ def test_locker_properly_loads_nested_extras(locker: Locker): category = "main" optional = false python-versions = "*" +files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"a" = [] -"b" = [] -"c" = [] """ # noqa: E800 locker.lock.write(tomlkit.parse(content)) @@ -356,6 +341,7 @@ def test_locker_properly_loads_extras_legacy(locker: Locker): category = "main" optional = false python-versions = "*" +files = [] [package.dependencies] b = {{version = "^1.0", optional = true}} @@ -370,15 +356,12 @@ def test_locker_properly_loads_extras_legacy(locker: Locker): category = "main" optional = false python-versions = "*" +files = [] [metadata] python-versions = "*" -lock-version = "1.2" +lock-version = "2.0" content-hash = "123456789" - -[metadata.files] -"a" = [] -"b" = [] """ # noqa: E800 locker.lock.write(tomlkit.parse(content)) @@ -407,6 +390,7 @@ def test_locker_properly_loads_subdir(locker: Locker) -> None: optional = false python-versions = "*" develop = false +files = [] [package.source] type = "git" @@ -416,12 +400,9 @@ def test_locker_properly_loads_subdir(locker: Locker) -> None: subdirectory = "subdir" [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -git-package-subdir = [] """ locker.lock.write(tomlkit.parse(content)) @@ -571,12 +552,9 @@ def test_lock_packages_with_null_description(locker: Locker, root: ProjectPackag files = [] [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -A = [] """ # noqa: E800 assert content == expected @@ -615,12 +593,9 @@ def test_lock_file_should_not_have_mixed_types(locker: Locker, root: ProjectPack foo = ["B (>=1.0.0)"] [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -A = [] """ # noqa: E800 with locker.lock.open(encoding="utf-8") as f: @@ -640,6 +615,7 @@ def test_reading_lock_file_should_raise_an_error_on_invalid_data(locker: Locker) category = "main" optional = false python-versions = "*" +files = [] [package.extras] foo = ["bar"] @@ -648,12 +624,9 @@ def test_reading_lock_file_should_raise_an_error_on_invalid_data(locker: Locker) foo = ["bar"] [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -A = [] """ # noqa: E800 with locker.lock.open("w", encoding="utf-8") as f: f.write(content) @@ -699,12 +672,9 @@ def test_locking_legacy_repository_package_should_include_source_section( reference = "legacy" [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -A = [] """ # noqa: E800 assert content == expected @@ -719,8 +689,6 @@ def test_locker_should_emit_warnings_if_lock_version_is_newer_but_allowed( lock-version = "{version}" python-versions = "~2.7 || ^3.4" content-hash = "c3d07fca33fba542ef2b2a4d75bf5b48d892d21a830e2ad9c952ba5123a52f77" - -[metadata.files] """ caplog.set_level(logging.WARNING, logger="poetry.packages.locker") @@ -748,11 +716,9 @@ def test_locker_should_raise_an_error_if_lock_version_is_newer_and_not_allowed( # {GENERATED_COMMENT} [metadata] -lock-version = "2.0" +lock-version = "3.0" python-versions = "~2.7 || ^3.4" content-hash = "c3d07fca33fba542ef2b2a4d75bf5b48d892d21a830e2ad9c952ba5123a52f77" - -[metadata.files] """ # noqa: E800 caplog.set_level(logging.WARNING, logger="poetry.packages.locker") @@ -789,12 +755,9 @@ def test_extras_dependencies_are_ordered(locker: Locker, root: ProjectPackage): B = {{version = "^1.0.0", extras = ["a", "b", "c"], optional = true}} [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -A = [] """ # noqa: E800 with locker.lock.open(encoding="utf-8") as f: @@ -806,10 +769,7 @@ def test_extras_dependencies_are_ordered(locker: Locker, root: ProjectPackage): def test_locker_should_neither_emit_warnings_nor_raise_error_for_lower_compatible_versions( # noqa: E501 locker: Locker, caplog: LogCaptureFixture ): - current_version = Version.parse(Locker._VERSION) - older_version = ".".join( - [str(current_version.major), str(current_version.minor - 1)] - ) + older_version = "1.1" content = f"""\ [metadata] lock-version = "{older_version}" @@ -887,12 +847,9 @@ def test_locker_dumps_dependency_information_correctly( F = {{git = "https://github.com/python-poetry/poetry.git", branch = "foo"}} [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -A = [] """ # noqa: E800 assert content == expected @@ -935,12 +892,9 @@ def test_locker_dumps_subdir(locker: Locker, root: ProjectPackage) -> None: subdirectory = "subdir" [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -git-package-subdir = [] """ # noqa: E800 assert content == expected @@ -984,12 +938,9 @@ def test_locker_dumps_dependency_extras_in_correct_order( C = ["first (==1.0.0)", "second (==1.0.0)", "third (==1.0.0)"] [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -A = [] """ # noqa: E800 assert content == expected @@ -1009,6 +960,7 @@ def test_locked_repository_uses_root_dir_of_package( optional = false python-versions = "^2.7.9" develop = true +file = [] [package.dependencies] lib-b = {{path = "../libB", develop = true}} @@ -1018,13 +970,9 @@ def test_locked_repository_uses_root_dir_of_package( url = "lib/libA" [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -lib-a = [] -lib-b = [] """ # noqa: E800 locker.lock.write(tomlkit.parse(content)) @@ -1166,12 +1114,9 @@ def test_lock_file_resolves_file_url_symlinks(root: ProjectPackage): resolved_reference = "123456" [metadata] -lock-version = "1.2" +lock-version = "2.0" python-versions = "*" content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" - -[metadata.files] -local-package = [] """ # noqa: E800 assert content == expected