Skip to content

Commit

Permalink
Merge pull request #1739 from tommilligan/poetry-v1
Browse files Browse the repository at this point in the history
python: upgrade to poetry ^1.0.0
  • Loading branch information
jurre committed Mar 24, 2020
2 parents eabf044 + 46112dc commit 3fc96b9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions bin/docker-dev-shell
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ docker run --rm -ti \
-v "$(pwd)/github_actions/spec:$CODE_DIR/github_actions/spec" \
-v "$(pwd)/python/Gemfile:$CODE_DIR/python/Gemfile" \
-v "$(pwd)/python/dependabot-python.gemspec:$CODE_DIR/python/dependabot-python.gemspec" \
-v "$(pwd)/python/helpers:/opt/python" \
-v "$(pwd)/python/helpers:/opt/python/helpers" \
-v "$(pwd)/python/lib:$CODE_DIR/python/lib" \
-v "$(pwd)/python/spec:$CODE_DIR/python/spec" \
-v "$(pwd)/nuget/Gemfile:$CODE_DIR/nuget/Gemfile" \
Expand Down
3 changes: 2 additions & 1 deletion python/helpers/lib/hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import pipfile
from poetry.poetry import Poetry
from poetry.factory import Factory

def get_dependency_hash(dependency_name, dependency_version, algorithm):
hashes = hashin.get_package_hashes(
Expand All @@ -18,6 +19,6 @@ def get_pipfile_hash(directory):
return json.dumps({ "result": p.hash })

def get_pyproject_hash(directory):
p = Poetry.create(directory)
p = Factory().create_poetry(directory)

return json.dumps({ "result": p.locker._get_content_hash() })
2 changes: 1 addition & 1 deletion python/helpers/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pip-tools==4.5.1
hashin==0.14.6
pipenv==2018.11.26
pipfile==0.0.2
poetry==0.12.17
poetry==1.0.5

# Some dependencies will only install if Cython is present
Cython==0.29.15
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
)
end

pending "updates the lockfile successfully" do
it "updates the lockfile successfully" do
updated_lockfile = updated_files.find { |f| f.name == "pyproject.lock" }

lockfile_obj = TomlRB.parse(updated_lockfile.content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
let(:pyproject_fixture_name) { "python_2.toml" }
let(:lockfile_fixture_name) { "python_2.lock" }

pending "resolves version" do
it "resolves version" do
is_expected.to eq(Gem::Version.new("2.18.4"))
end
end
Expand Down

0 comments on commit 3fc96b9

Please sign in to comment.