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

Stop installing custom python versions #3484

Merged
merged 4 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
/.bundle
/.core-bash_history
/.env
/.envrc
/.git
/tmp/
/helpers
/spec
gitignored
/bundler/helpers/helpers/
/python/helpers/helpers/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this was ignoring

/.vscode-server-insiders/
/.vscode-server/
/.vscode/
/dependabot-*.gem
/dry-run
/pkg
/vendor
/tmp
**/.bundle
**/coverage
**/Gemfile.lock
**/node_modules
!**/spec/fixtures/*
git.store
.byebug_history
.DS_Store
*.pyc
29 changes: 21 additions & 8 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
FROM dependabot/dependabot-core

# We pre-install these versions of python as they're known to be used in the
# test suite. These used to be installed in-line, and pre-installing them helps
# with the performance of the python test suite.
RUN pyenv install -s 3.6.13 \
&& pyenv install -s 3.7.1 \
&& pyenv install -s 3.7.10 \
&& git config --global user.name dependabot-ci \
RUN git config --global user.name dependabot-ci \
&& git config --global user.email no-reply@github.com

ARG CODE_DIR=/home/dependabot/dependabot-core
WORKDIR ${CODE_DIR}
COPY --chown=dependabot:dependabot . ${CODE_DIR}

COPY --chown=dependabot:dependabot .rubocop.yml ${CODE_DIR}/.rubocop.yml
COPY --chown=dependabot:dependabot omnibus ${CODE_DIR}/omnibus
COPY --chown=dependabot:dependabot dep ${CODE_DIR}/dep
COPY --chown=dependabot:dependabot git_submodules ${CODE_DIR}/git_submodules
COPY --chown=dependabot:dependabot terraform ${CODE_DIR}/terraform
COPY --chown=dependabot:dependabot github_actions ${CODE_DIR}/github_actions
COPY --chown=dependabot:dependabot hex ${CODE_DIR}/hex
COPY --chown=dependabot:dependabot elm ${CODE_DIR}/elm
COPY --chown=dependabot:dependabot docker ${CODE_DIR}/docker
COPY --chown=dependabot:dependabot nuget ${CODE_DIR}/nuget
COPY --chown=dependabot:dependabot maven ${CODE_DIR}/maven
COPY --chown=dependabot:dependabot gradle ${CODE_DIR}/gradle
COPY --chown=dependabot:dependabot cargo ${CODE_DIR}/cargo
COPY --chown=dependabot:dependabot composer ${CODE_DIR}/composer
COPY --chown=dependabot:dependabot go_modules ${CODE_DIR}/go_modules
COPY --chown=dependabot:dependabot python ${CODE_DIR}/python
COPY --chown=dependabot:dependabot npm_and_yarn ${CODE_DIR}/npm_and_yarn
COPY --chown=dependabot:dependabot bundler ${CODE_DIR}/bundler
COPY --chown=dependabot:dependabot common ${CODE_DIR}/common
2 changes: 0 additions & 2 deletions bundler/helpers/v1/.bundle/config

This file was deleted.

3 changes: 1 addition & 2 deletions bundler/helpers/v1/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/.bundle/*
!/.bundle/config
/.bundle
/.env
/tmp
/dependabot-*.gem
Expand Down
2 changes: 1 addition & 1 deletion bundler/helpers/v1/build
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ fi

helpers_dir="$(dirname "${BASH_SOURCE[0]}")"
cp -r \
"$helpers_dir/.bundle" \
"$helpers_dir/lib" \
"$helpers_dir/monkey_patches" \
"$helpers_dir/run.rb" \
Expand All @@ -21,5 +20,6 @@ cd "$install_dir"

# NOTE: Sets `BUNDLED WITH` to match the installed v1 version in Gemfile.lock
# forcing native helpers to run with the same version
BUNDLER_VERSION=2 bundle config set --local path ".bundle"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying setup from v2

BUNDLER_VERSION=1 bundle config set --local without "test"
BUNDLER_VERSION=1 bundle install
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,10 @@
let(:requirements_file) do
Dependabot::DependencyFile.new(
name: "runtime.txt",
content: "python-3.7.1"
content: fixture(
"requirements",
"version_not_specified_runtime.txt"
)
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
require "dependabot/dependency_file"
require "dependabot/python/update_checker/pipenv_version_resolver"

namespace = Dependabot::Python::UpdateChecker
RSpec.describe namespace::PipenvVersionResolver do
RSpec.describe Dependabot::Python::UpdateChecker::PipenvVersionResolver do
let(:resolver) do
described_class.new(
dependency: dependency,
Expand Down
2 changes: 1 addition & 1 deletion python/spec/fixtures/pip_compile_files/met_marker.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flaky; python_version < '3.7'
flaky; python_version < '2.8'
pytest
pytest-xdist
mock
Expand Down
2 changes: 1 addition & 1 deletion python/spec/fixtures/pyproject_files/exact_version.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ authors = ["Dependabot <support@dependabot.com>"]
description = "Various small python projects."

[tool.poetry.dependencies]
python = "^3.7"
python = "*"
requests = "2.18.0"
2 changes: 1 addition & 1 deletion python/spec/fixtures/pyproject_locks/exact_version.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ version = "1.21.1"
[metadata]
content-hash = "a8d5762e953227a34625a209e9cc67a1c6fb2d7a971845829cf2f9cf61a5bd7c"
platform = "*"
python-versions = "^3.7"
python-versions = "*"

[metadata.hashes]
certifi = ["13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7", "9fa520c1bacfb634fa7af20a76bcbd3d5fb390481724c597da32c719a7dca4b0"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ apipkg==1.5 # via execnet
atomicwrites==1.3.0 # via pytest
attrs==17.3.0
execnet==1.6.0 # via pytest-xdist
flaky==3.5.0 ; python_version < "3.7"
flaky==3.5.0 ; python_version < "2.8"
mock==3.0.3
more-itertools==7.0.0 # via pytest
pluggy==0.9.0 # via pytest
Expand Down