Skip to content

PROD-1074: Upgrade to django 2.2.#36

Merged
azarembok merged 1 commit intomasterfrom
azarembok/django2
Dec 16, 2019
Merged

PROD-1074: Upgrade to django 2.2.#36
azarembok merged 1 commit intomasterfrom
azarembok/django2

Conversation

@azarembok
Copy link
Copy Markdown
Contributor

@azarembok azarembok commented Dec 6, 2019

Description: This PR updates code-annotations to be compatibile with django 2.2. It also adds tox environments for testing django 1.11, 2.0, 2.1, 2.2. Finally it fixes some lint errors that arose while updating dependencies.

JIRA: Link to JIRA ticket

Dependencies: dependencies on other outstanding PRs, issues, etc.

Merge deadline: List merge deadline (if any)

Installation instructions: List any non-trivial installation
instructions.

Testing instructions:

  1. Do thing A
  2. Expect B to happen
  3. If C happened instead - check failed.

Reviewers:

  • tag reviewer
  • tag reviewer

Merge checklist:

  • All reviewers approved
  • CI build is green
  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed
  • PR author is listed in AUTHORS

Post merge:

  • Create a tag
  • Check new version is pushed to PyPi after tag-triggered build is
    finished.
  • Delete working branch (if not needed anymore)

Author concerns: List any concerns about this PR - inelegant
solutions, hacks, quick-and-dirty implementations, concerns about
migrations, etc.

@azarembok azarembok force-pushed the azarembok/django2 branch 2 times, most recently from d824919 to 1b1c8ff Compare December 10, 2019 18:02
Comment thread code_annotations/__init__.py
Copy link
Copy Markdown

@fysheets fysheets left a comment

Choose a reason for hiding this comment

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

Left questions for clarity and understanding

Comment thread code_annotations/base.py Outdated
@@ -7,5 +7,3 @@ class ConfigurationException(Exception):
"""
Exception specific to code annotation configuration problems.
"""
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is there any value in this file at all now that it's an empty definition?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes...various places in the code raise ConfigurationException and pass in a specific message. Callers of those functions can check for this exception specifically, which is better than looking for the generic Exception.

Comment thread pylintrc_tweaks
Comment thread requirements/base.in
Comment thread tests/helpers.py
Comment thread .travis.yml
- python: 3.6
env: TOXENV=py36
env: TOXENV=py36-django111
- python: 3.6
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note that we're actually using Python 3.5 for now; we were originally planning on using 3.6, but instead went with the version that comes with our current Ubuntu release. I suspect we'll later be skipping over 3.6 and going straight to 3.8.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since we already have 3.6 working, I updated the configuration to run the tests on both 3.5 and 3.6.

Comment thread code_annotations/cli.py Outdated
click.echo("\n".join(searcher.errors))
# If there are any errors, do not continue
exit(-1)
sys.exit(-1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pre-existing problem, but -1 seems like an odd choice of code given that:

Most systems require it to be in the range 0–127, and produce undefined results otherwise.

https://docs.python.org/3.5/library/sys.html#sys.exit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I am changing all of these occurrences to use 1 instead.

# These packages are backports which can only be installed on Python 2.7
futures ; python_version == "2.7"
more-itertools<6
pytest==4.6.7
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These two should probably get their own comments for why they've been constrained.

Comment thread requirements/dev.txt
edx-lint==1.4.1
filelock==3.0.12
funcsigs==1.0.2
futures==3.2.0 ; python_version == "2.7"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It looks like you ran make upgrade under Python 3; until we officially drop Python 2 support, we need to keep running it under 2.7 to pin all the backports that are only needed under that version.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I reran it under 2.7.

@azarembok
Copy link
Copy Markdown
Contributor Author

@fysheets @jmbowman I believe I have addressed all of your comments, please have another look when you get a chance. Thanks!

Copy link
Copy Markdown

@jmbowman jmbowman left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Copy link
Copy Markdown

@fysheets fysheets left a comment

Choose a reason for hiding this comment

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

👍

@azarembok azarembok merged commit 4a9b484 into master Dec 16, 2019
@azarembok azarembok deleted the azarembok/django2 branch December 16, 2019 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants