Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vendoring: split sync and update make targets #89

Merged
merged 2 commits into from
Mar 12, 2021

Conversation

abn
Copy link
Member

@abn abn commented Sep 26, 2020

The sync target previously regenerated the poetry.lock for vendored
packages, causing larger than necessary change set for patches. This
change introduces the update target to specifically handle lock file
updates, lock target to regenerate the lock file and repurpose the sync
target to only sync as expected.

@abn abn requested a review from a team September 26, 2020 21:14
@sinoroc
Copy link

sinoroc commented Oct 10, 2020

I modified vendors/pyproject.toml as following:

$ git diff vendors/pyproject.toml 
diff --git a/vendors/pyproject.toml b/vendors/pyproject.toml
index 69ccbd0..75d101c 100644
--- a/vendors/pyproject.toml
+++ b/vendors/pyproject.toml
@@ -22,6 +22,6 @@ classifiers = [
 python = "^3.6"
 
 jsonschema = "^3.2.0"
-lark-parser = "^0.9.0"
+lark-parser = { git = "https://github.com/MegaIng/lark.git", branch = "custom_import_sources" }
 packaging = "^20.1"
 tomlkit = ">=0.7.0,<1.0.0"

Then I ran make vendor/sync:

$ make SHELL=bash vendor/sync 
# regenerate vendor.txt file (exported from lockfile)
~/workspace/poetry-core/vendors ~/workspace/poetry-core
# vendor packages
Load configuration... Done!
Clean existing libraries... Done!
Add vendored libraries...  
  Running pip install -t poetry/core/_vendor -r poetry/core/_vendor/vendor.txt --no-compile --no-deps
    ERROR: Invalid requirement: 'Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.' (from line 9 of poetry/core/_vendor/vendor.txt)
  Command exited with non-zero exit code: 1
# strip out *.pyi stubs

Indeed the following has been generated in poetry/core/_vendor/vendor.txt

$ git diff poetry/core/_vendor/vendor.txt 
diff --git a/poetry/core/_vendor/vendor.txt b/poetry/core/_vendor/vendor.txt
index a1c24ba..b6a594b 100644
--- a/poetry/core/_vendor/vendor.txt
+++ b/poetry/core/_vendor/vendor.txt
@@ -1,8 +1,9 @@
 attrs==19.3.0
 jsonschema==3.2.0
-lark-parser==0.9.0
+lark-parser @ git+https://github.com/MegaIng/lark.git@custom_import_sources
 packaging==20.4
 pyparsing==2.4.7
 pyrsistent==0.16.0
 six==1.15.0
 tomlkit==0.7.0
+Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
abn added 2 commits March 12, 2021 01:39
The sync target previously regenerated the poetry.lock for vendored
packages, causing larger than necessary change set for patches. This
change introduces the update target to specifically handle lock file
updates, lock target to regenerate the lock file and repurpose the sync
target to only sync as expected.
@abn abn merged commit 9a8cd00 into python-poetry:master Mar 12, 2021
@abn abn deleted the vendoring/make branch March 12, 2021 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants