Skip to content

Commit

Permalink
Merge pull request #682 from maresb/vendoring-script
Browse files Browse the repository at this point in the history
Add vendoring script
  • Loading branch information
maresb authored Sep 7, 2024
2 parents 1d33e10 + 75da51c commit 7631f1f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conda_lock/_vendor/cleo.LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion conda_lock/_vendor/cleo.pyi

This file was deleted.

44 changes: 44 additions & 0 deletions conda_lock/scripts/vendor_poetry/rerun_vendoring.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

set -euo pipefail

if ! command -v vendoring &> /dev/null; then
echo "vendoring not found on PATH. Please install vendoring with 'pip install vendoring'."
exit 1
fi

if ! command -v dos2unix &> /dev/null; then
echo "dos2unix not found on PATH. Please install dos2unix with 'apt-get install dos2unix' or 'brew install dos2unix'."
exit 1
fi

if [ ! -f pyproject.toml ]; then
echo "pyproject.toml not found in the current directory. Please run this script from the root of the project:"
echo " conda_lock/scripts/vendor_poetry/rerun_vendoring.sh"
exit 1
fi

vendoring sync -vvv .

echo Fixing CRLF line endings...
dos2unix conda_lock/_vendor/poetry/core/_vendor/lark/grammars/*
dos2unix conda_lock/_vendor/poetry/core/_vendor/fastjsonschema/*
dos2unix conda_lock/_vendor/conda/_vendor/boltons/LICENSE
dos2unix conda_lock/_vendor/poetry/core/_vendor/lark/LICENSE

echo Downloading missing licenses...
for package in poetry poetry-core cleo; do
curl -s "https://raw.githubusercontent.com/python-poetry/${package}/master/LICENSE" > "conda_lock/_vendor/${package}.LICENSE"
done

echo Removing duplicate licenses...
# This one is actually correct, but we downloaded it to poetry-core.LICENSE above.
diff conda_lock/_vendor/poetry_core.LICENSE conda_lock/_vendor/poetry-core.LICENSE
rm conda_lock/_vendor/poetry-core.LICENSE
# These are licenses for poetry_core's vendored 'packaging', not poetry_core itself.
diff conda_lock/_vendor/poetry/core/_vendor/packaging/LICENSE.APACHE conda_lock/_vendor/poetry_core.LICENSE.APACHE
diff conda_lock/_vendor/poetry/core/_vendor/packaging/LICENSE.BSD conda_lock/_vendor/poetry_core.LICENSE.BSD
rm conda_lock/_vendor/poetry_core.LICENSE.APACHE
rm conda_lock/_vendor/poetry_core.LICENSE.BSD

echo "Vendoring complete. Please commit the changes."

0 comments on commit 7631f1f

Please sign in to comment.