Skip to content

Commit

Permalink
Remove outdated Django version warning
Browse files Browse the repository at this point in the history
Since:
- the version check was pretty broken (only matches against
  that exact requirements file version syntax, plus doesn't
  check unpinned but still outdated version etc)
- it only warned for Django 1.x, when there are lots of other
  EOL Django versions since then
- it feels inconsistent for us to warn about one framework being
   EOL when there are lots of other packages and frameworks out
   there that should also be kept up to date too -- that's best handled
   by services like Dependabot security alerts etc

If at such time in the future our Django collectstatic feature requires a
specific version of Django, any version checking/warning should occur
as part of that feature.

GUS-W-11593026.
  • Loading branch information
edmorley committed Aug 14, 2022
1 parent 5f896a4 commit d87b5d7
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 38 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Remove outdated Django version warning ([#1345](https://github.com/heroku/heroku-buildpack-python/pull/1345)).

## v214 (2022-08-02)

Expand Down
8 changes: 0 additions & 8 deletions bin/steps/pip-install
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
mcount "failure.none-version"
fi

# TODO: Either remove this or fix since it's pretty broken at the moment - for example it
# doesn't match against a requirements specifier of 'Django >=1.11,<2' amongst others.
if grep -qi '^django==1.*' requirements.txt; then
puts-warn "Your Django version is nearing the end of its community support."
puts-warn "Upgrade to continue to receive security updates and for the best experience with Django."
puts-warn "For more information, check out https://www.djangoproject.com/download/#supported-versions"
fi

if [ ! -f "$BUILD_DIR/.heroku/python/bin/pip" ]; then
exit 1
fi
Expand Down
1 change: 0 additions & 1 deletion spec/fixtures/requirements_django_1.11/requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/fixtures/requirements_django_2.1/requirements.txt

This file was deleted.

27 changes: 0 additions & 27 deletions spec/hatchet/django_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,6 @@
require_relative '../spec_helper'

RSpec.describe 'Django support' do
describe 'Unsupported version warnings' do
context 'when requirements.txt contains Django==1.11' do
let(:app) { Hatchet::Runner.new('spec/fixtures/requirements_django_1.11') }

it 'warns about Django end of support' do
app.deploy do |app|
expect(clean_output(app.output)).to include(<<~OUTPUT)
remote: -----> Installing requirements with pip
remote: ! Your Django version is nearing the end of its community support.
remote: ! Upgrade to continue to receive security updates and for the best experience with Django.
remote: ! For more information, check out https://www.djangoproject.com/download/#supported-versions
OUTPUT
end
end
end

context 'when requirements.txt contains Django==2.1' do
let(:app) { Hatchet::Runner.new('spec/fixtures/requirements_django_2.1') }

it 'does not warn about Django end of support' do
app.deploy do |app|
expect(app.output).not_to include('https://www.djangoproject.com/download/#supported-versions')
end
end
end
end

describe 'collectstatic' do
context 'when building a Django project' do
let(:app) { Hatchet::Runner.new('python-getting-started') }
Expand Down

0 comments on commit d87b5d7

Please sign in to comment.