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

Update requirements to fix pip-compile issues #169

Merged
merged 5 commits into from
Mar 12, 2020

Conversation

kaizoku
Copy link
Contributor

@kaizoku kaizoku commented Feb 24, 2020

When updating requirements for open-craft/problem-builder#262, we were unable to get pip-compile to resolve dependencies, as the xblock inherits requirements from xblock-sdk, and there were unresolvable dependencies.

This updates 2 requirements to allow pip-upgrade to work in both xblock-sdk and problem-builder requirements.

Reviewers

@openedx-webhooks
Copy link

Thanks for the pull request, @kaizoku! I've created OSPR-4113 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams.

Feel free to add as much of the following information to the ticket:

  • supporting documentation
  • edx-code email threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here.

@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels Feb 24, 2020
@lgp171188
Copy link

@kaizoku, it looks like the changes in this PR break CI checks, particularly the Python 2.7 ones. So we have to decide on supporting Python 2.7 (for the current and older releases) and if we decide not to, I think a major version bump for this library will be required to indicate a backward-incompatible change.

@feanil, @jmbowman, as the reviewers of the recently merged PRs in this repo, can you check this out when you can and let us know your thoughts?

markupsafe==1.1.1 # via jinja2, mako, xblock
mccabe==0.6.1 # via pylint
mock==3.0.5
more-itertools==5.0.0 # via pytest, zipp
more-itertools==8.2.0 # via pytest

Choose a reason for hiding this comment

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

@kaizoku, this breaks the Python 2.7 (which I think it still supported, based on the documentation in the README file) integration tests.

astroid==1.6.6 # via pylint, pylint-celery
atomicwrites==1.3.0 # via pytest
appdirs==1.4.3 # via fs, virtualenv
astroid==2.3.3 # via pylint, pylint-celery

Choose a reason for hiding this comment

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

@kaizoku, this breaks the CI checks here.

@jmbowman
Copy link

We've started dropping Python 2.7 support from a number of repositories, figuring that most things should be on Python 3 by now and the few stragglers can stay pinned to older versions that still support 2.7. So I'm ok with dropping the Python 2.7 support, but that should probably be a PR of its own.

To fix CI while retaining Python 2.7 support, you can add a constraints.txt file and reference it in the *.in requirements files as described here, and then restrict the dependencies that have dropped Python 2.7 support to versions before that happened. We'll need the constraints file soon anyway, as many packages have already dropped Python 3.5 support also.

@natabene
Copy link

@kaizoku Thank you for your contribution. Please let me know once this is ready for our review.

@openedx-webhooks openedx-webhooks added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed needs triage labels Feb 24, 2020
@kaizoku
Copy link
Contributor Author

kaizoku commented Feb 27, 2020

Thanks for the tip @jmbowman. I've updated the PR, and tox passes on my machine, but I can't retrigger the tests on here.

@natabene this should be ready for review once tests re-run.

@jmbowman
Copy link

The tests are passing on Travis now, but the quality checks are failing. Looks like pydocstyle needs to be constrained to be lower than version 4.0.0 (which dropped Python 2 support). And there's one lint failure complaining about use of a deprecated method.

1 similar comment
@jmbowman
Copy link

The tests are passing on Travis now, but the quality checks are failing. Looks like pydocstyle needs to be constrained to be lower than version 4.0.0 (which dropped Python 2 support). And there's one lint failure complaining about use of a deprecated method.

@kaizoku
Copy link
Contributor Author

kaizoku commented Feb 28, 2020

Ah sorry I didn't check the quality on my local machine @jmbowman.

I added the pydocstyle constraint for Python 2.7 support. The Python 2.7 quality tests are passing now.

Python 3 documentation notes that "This method was previously documented as deprecated in favour of signature() in Python 3.5, but that decision has been reversed".

Is it safe to add a pylint ignore deprecation for this function for now, given that it won't actually be deprecated?

@lgp171188
Copy link

Is it safe to add a pylint ignore deprecation for this function for now, given that it won't actually be deprecated?

@kaizoku, 👍 It could also be useful to link to the relevant documentation to indicate why we are ignoring that warning.

pylint warns about a deprecated function during quality checks.
This function was meant to be deprecated, but python maintainers decided
to reverse this decision.
https://docs.python.org/3/library/inspect.html#inspect.getfullargspec
@kaizoku
Copy link
Contributor Author

kaizoku commented Feb 28, 2020

@lgp171188 thanks! I added the pylint ignore.

Copy link

@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.

Sorry, lost track of this one. Looks good, merging.

@jmbowman jmbowman merged commit e3d8f2a into openedx:master Mar 12, 2020
@openedx-webhooks
Copy link

@kaizoku 🎉 Your pull request was merged!

Please take a moment to answer a two question survey so we can improve your experience in the future.

@lgp171188
Copy link

@jmbowman, thanks for reviewing and merging this PR. Can you tag a new release that includes the changes in this PR so that we can use that in open-craft/problem-builder#262?

@lgp171188
Copy link

@jmbowman, did you get a chance to check my previous comment about tagging a new release?

@jmbowman
Copy link

Sorry, I apparently missed the notification for your last message; done: https://github.com/edx/xblock-sdk/releases/tag/v0.1.8

certifi==2019.11.28 # via requests
chardet==3.0.4 # via binaryornot, requests
cookiecutter==0.9.0
django-pyfs==2.0
django==1.11.26
django==2.2.10

Choose a reason for hiding this comment

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

@kaizoku Was this intended? django 2.2.10 isn't supported on python2. Discovered by a user on this forum thread: https://discuss.openedx.org/t/xblock-django-installation-failiure/1802

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@swalladge, not really, no. This PR was to update requirements so they would work for Django 2.2 and Python 3. There was a previous PR (https://github.com/edx/xblock-sdk/pull/165/files) for Django 2.2 support, but requirements wouldn't compile successfully still, which is why I opened this PR. I see that README.md still says Python 2.7 though, which is misleading now.

Unfortunately pip-compile completely ignores python_version directives, and they've stated they won't support them, so there isn't really a good way to have different django requirements for different python versions as long as we're using pip-tools.

Should we add extra documentation to note which versions of xblock-utils are Django 1.11 compatible vs Django 2.2?

Choose a reason for hiding this comment

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

Should we add extra documentation to note which versions of xblock-utils are Django 1.11 compatible vs Django 2.2?

Probably yes. Currently, python2 support has been unexpectedly dropped with this PR. It sounds like formally dropping python2 is going to happen soon anyway; it's just happened sooner than expected. :P

@openedx-webhooks openedx-webhooks added merged and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged open-source-contribution PR author is not from Axim or 2U
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants