-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Poetry Feature #807
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
Closed
Closed
Poetry Feature #807
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
04d81e8
improved detection by detecting lock files aswell
AndreGuerra123 82848d2
improved pipenv python detection
AndreGuerra123 ebd9576
creating pipfile.lock only test project and correct smll bugs
AndreGuerra123 c72b156
improving pipenv
AndreGuerra123 9119d79
improve pipenv
AndreGuerra123 cb2e359
improved version selection pipenv
AndreGuerra123 093a7eb
improved pipenv version
AndreGuerra123 70b9b69
added similar poetry step
AndreGuerra123 b167499
added poetry to compile
AndreGuerra123 b173929
bug in poetry ^' extraction
AndreGuerra123 0cfa5fb
adding utils to extractors and compile with poetry
AndreGuerra123 fc785ae
reverted last commits
AndreGuerra123 8e5cad7
improvements in poetry
AndreGuerra123 cb5bbe5
bug in poetry
AndreGuerra123 85742d9
improvement on poetry
AndreGuerra123 2c3d34c
improving poetry
AndreGuerra123 cd2728a
trying to correct issue
AndreGuerra123 a37647e
reversed pipenv python
AndreGuerra123 d7f71d1
update pipenv python
AndreGuerra123 e5875c3
pipenv
AndreGuerra123 5b7416d
improving pipenv
AndreGuerra123 87455f5
improvement on pipenv
AndreGuerra123 43ec4a2
pipenv final version
AndreGuerra123 3b04889
final versioning from pipenv bug fix
AndreGuerra123 176d406
bug fix on utils
AndreGuerra123 c0b961a
bufg fix removed utils nonused functions
AndreGuerra123 343fea5
something went wrong
AndreGuerra123 e213019
improving poetry versions
AndreGuerra123 df01261
improving poetry
AndreGuerra123 469f483
adding pyhton verion to lock
AndreGuerra123 77c6901
test pipenv install
AndreGuerra123 7909185
adding PIPENV VERSION as a ENV VAR
AndreGuerra123 358ec61
IMPROVEMENT
AndreGuerra123 229eb41
reverted for collectstatic failling
AndreGuerra123 63808a7
Revert "adding PIPENV VERSION as a ENV VAR"
AndreGuerra123 c3ec34c
new approach
AndreGuerra123 a71256a
improv pipenv
AndreGuerra123 a102afa
fix --system bug
AndreGuerra123 c7ef13c
updating
AndreGuerra123 6b8a196
testing
AndreGuerra123 3215915
test2
AndreGuerra123 d5dbc0c
reversed pipenv version
AndreGuerra123 cf78cec
test3
AndreGuerra123 ced5a9f
test5
AndreGuerra123 bcce3f0
test6
AndreGuerra123 e6fc575
test7
AndreGuerra123 284506a
test8
AndreGuerra123 bfa93b7
improving poetry
AndreGuerra123 d459acf
test1
AndreGuerra123 a4dac36
test2
AndreGuerra123 83d8794
test3
AndreGuerra123 016c979
overrid python detecion for testing
AndreGuerra123 d075055
testing
AndreGuerra123 61fc45f
submit
AndreGuerra123 8e85f30
test2
AndreGuerra123 a5b821a
TEST3
AndreGuerra123 0bb436a
test5
AndreGuerra123 cb0ed6f
test7
AndreGuerra123 b9ebdc7
final maybe
AndreGuerra123 56d2b28
aed
AndreGuerra123 64e6491
test1
AndreGuerra123 2a8990b
test2
AndreGuerra123 e0e6fcb
test5
AndreGuerra123 948585a
test6
AndreGuerra123 9bba088
collect static with poetry
AndreGuerra123 d0b2688
Tested Poetry Feature
AndreGuerra123 cf18eb1
Merge branch 'master' of https://github.com/AndreGuerra123/heroku-bui…
AndreGuerra123 a007102
Poetry Feature Added
AndreGuerra123 9d13baf
Merge branch 'master' of https://github.com/AndreGuerra123/heroku-bui…
AndreGuerra123 676f1eb
Merge branch 'master' into master
AndreGuerra123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"python.linting.pylintEnabled": false | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,60 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Detect Python-version with Pipenv. | ||
|
||
if [[ -f $BUILD_DIR/Pipfile ]]; then | ||
if [[ -f $BUILD_DIR/Pipfile || -f $BUILD_DIR/Pipfile.lock ]]; then | ||
|
||
if [[ ! -f $BUILD_DIR/runtime.txt ]]; then | ||
if [[ ! -f $BUILD_DIR/Pipfile.lock ]]; then | ||
puts-warn "No 'Pipfile.lock' found! We recommend you commit this into your repository." | ||
fi | ||
if [[ -f $BUILD_DIR/Pipfile.lock ]]; then | ||
set +e | ||
PYTHON=$(jq -r '._meta.requires.python_full_version' "$BUILD_DIR/Pipfile.lock") | ||
if [[ "$PYTHON" != "null" ]]; then | ||
PYTHON=$(sed -nr "/^\[requires\]/ { :l /^python_full_version[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" "$BUILD_DIR/Pipfile" | tr -d '"') | ||
if ! [ -z "$PYTHON"]; then | ||
echo "python-$PYTHON" > "$BUILD_DIR/runtime.txt" | ||
else | ||
PYTHON=$(sed -nr "/^\[requires\]/ { :l /^python_version[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" "$BUILD_DIR/Pipfile" | tr -d '"') | ||
if ! [ -z "$PYTHON"]; then | ||
if [ "$PYTHON" = 2.7 ]; then | ||
echo "$LATEST_27" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
if [ "$PYTHON" = 3.4 ]; then | ||
echo "$LATEST_34" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
if [ "$PYTHON" = 3.5 ]; then | ||
echo "$LATEST_35" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
if [ "$PYTHON" = 3.6 ]; then | ||
echo "$LATEST_36" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
if [ "$PYTHON" = 3.7 ]; then | ||
echo "$LATEST_37" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
fi | ||
fi | ||
set -e | ||
|
||
if [[ "$PYTHON" == "null" ]]; then | ||
else | ||
set +e | ||
PYTHON=$(jq -r '._meta.requires.python_full_version' "$BUILD_DIR/Pipfile.lock") | ||
if [[ "$PYTHON" != "null" ]]; then | ||
echo "python-$PYTHON" > "$BUILD_DIR/runtime.txt" | ||
else | ||
PYTHON=$(jq -r '._meta.requires.python_version' "$BUILD_DIR/Pipfile.lock") | ||
if [ "$PYTHON" = 2.7 ]; then | ||
echo "$LATEST_27" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
if [ "$PYTHON" = 3.6 ]; then | ||
echo "$LATEST_36" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
if [ "$PYTHON" = 3.7 ]; then | ||
echo "$LATEST_37" > "$BUILD_DIR/runtime.txt" | ||
if [[ "$PYTHON" != "null" ]]; then | ||
if [ "$PYTHON" = 2.7 ]; then | ||
echo "$LATEST_27" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
if [ "$PYTHON" = 3.4 ]; then | ||
echo "$LATEST_34" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
if [ "$PYTHON" = 3.5 ]; then | ||
echo "$LATEST_35" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
if [ "$PYTHON" = 3.6 ]; then | ||
echo "$LATEST_36" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
if [ "$PYTHON" = 3.7 ]; then | ||
echo "$LATEST_37" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
fi | ||
fi | ||
|
||
|
||
set -e | ||
fi | ||
fi | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
# shellcheck source=bin/utils | ||
source "$BIN_DIR/utils" | ||
set -e | ||
|
||
if [[ -f pyproject.toml || -f poetry.lock ]]; then | ||
mcount "tool.poetry" | ||
|
||
# Set Pip env varsz | ||
# This reads certain environment variables set on the Heroku app config | ||
# and makes them accessible to the pip install process. | ||
# PIP_EXTRA_INDEX_URL allows for an alternate pypi URL to be used. | ||
if [[ -r "$ENV_DIR/PIP_EXTRA_INDEX_URL" ]]; then | ||
PIP_EXTRA_INDEX_URL="$(cat "$ENV_DIR/PIP_EXTRA_INDEX_URL")" | ||
export PIP_EXTRA_INDEX_URL | ||
mcount "buildvar.PIP_EXTRA_INDEX_URL" | ||
fi | ||
|
||
# Set SLUGIFY_USES_TEXT_UNIDECODE, required for Airflow versions >=1.10 | ||
if [[ -r "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE" ]]; then | ||
SLUGIFY_USES_TEXT_UNIDECODE="$(cat "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE")" | ||
export SLUGIFY_USES_TEXT_UNIDECODE | ||
mcount "buildvar.SLUGIFY_USES_TEXT_UNIDECODE" | ||
fi | ||
|
||
# # Get Poetry Version from file | ||
if [[ -r "$ENV_DIR/POETRY_VERSION" ]]; then | ||
POETRY_VERSION="$(cat "$ENV_DIR/POETRY_VERSION")" | ||
export POETRY_VERSION | ||
mcount "buildvar.POETRY_VERSION" | ||
else | ||
export POETRY_VERSION="0.12.11" | ||
fi | ||
|
||
# Install poetry. | ||
/app/.heroku/python/bin/pip install poetry==$POETRY_VERSION 2>&1 | cleanup | indent | ||
|
||
# Install the dependencies. | ||
if [ "$INSTALL_TEST" ]; then | ||
puts-step "Installing default and development dependencies with Poetry $POETRY_VERSION…" | ||
/app/.heroku/python/bin/poetry install 2>&1 | cleanup | indent | ||
else | ||
puts-step "Installing default dependencies with Poetry $POETRY_VERSION…" | ||
/app/.heroku/python/bin/poetry install --no-dev 2>&1 | cleanup | indent | ||
fi | ||
|
||
/app/.heroku/python/bin/poetry run pip freeze > requirements.txt | ||
|
||
# Skip pip install later on. | ||
export SKIP_PIP_INSTALL=1 | ||
|
||
fi | ||
set +e | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
set +e | ||
if [[ -f $BUILD_DIR/pyproject.toml || -f $BUILD_DIR/poetry.lock ]]; then | ||
|
||
if [[ ! -f $BUILD_DIR/runtime.txt ]]; then | ||
|
||
if [[ ! -f $BUILD_DIR/poetry.lock ]]; then | ||
|
||
puts-warn "No 'poetry.lock' found! We recommend you commit this into your repository." | ||
PYTHON=$(sed -nr "/^\[tool.poetry.dependencies\]/ { :l /^python[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" "$BUILD_DIR/pyproject.toml" | tr -d '"^') | ||
echo $PYTHON | ||
if ! [ -z $PYTHON]; then | ||
if [[ "$PYTHON" == +([0-9]).+([0-9]).+([0-9]) ]]; then | ||
echo "python-$PYTHON" > "$BUILD_DIR/runtime.txt" | ||
elif [ $PYTHON = 2.7 ]; then | ||
echo "$LATEST_27" > "$BUILD_DIR/runtime.txt" | ||
elif [ "$PYTHON" = 3.4 ]; then | ||
echo "$LATEST_34" > "$BUILD_DIR/runtime.txt" | ||
elif [ "$PYTHON" = 3.5 ]; then | ||
echo "$LATEST_35" > "$BUILD_DIR/runtime.txt" | ||
elif [ "$PYTHON" = 3.6 ]; then | ||
echo "$LATEST_36" > "$BUILD_DIR/runtime.txt" | ||
elif [ "$PYTHON" = 3.7 ]; then | ||
echo "$LATEST_37" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
fi | ||
else | ||
PYTHON=$(sed -nr "/^\[metadata\]/ { :l /^python-versions[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" "$BUILD_DIR/poetry.lock" | tr -d '"^') | ||
if ! [ -z $PYTHON]; then | ||
if [[ "$PYTHON" == +([0-9]).+([0-9]).+([0-9]) ]]; then | ||
echo "python-$PYTHON" > "$BUILD_DIR/runtime.txt" | ||
elif [ $PYTHON = 2.7 ]; then | ||
echo "$LATEST_27" > "$BUILD_DIR/runtime.txt" | ||
elif [ "$PYTHON" = 3.4 ]; then | ||
echo "$LATEST_34" > "$BUILD_DIR/runtime.txt" | ||
elif [ "$PYTHON" = 3.5 ]; then | ||
echo "$LATEST_35" > "$BUILD_DIR/runtime.txt" | ||
elif [ "$PYTHON" = 3.6 ]; then | ||
echo "$LATEST_36" > "$BUILD_DIR/runtime.txt" | ||
elif [ "$PYTHON" = 3.7 ]; then | ||
echo "$LATEST_37" > "$BUILD_DIR/runtime.txt" | ||
fi | ||
fi | ||
fi | ||
fi | ||
fi | ||
|
||
set -e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: pyproject.py → pyproject.toml