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

fix: Fixed dependency issue that causes pip command to raise error #877

Merged
merged 1 commit into from
Oct 25, 2020
Merged

fix: Fixed dependency issue that causes pip command to raise error #877

merged 1 commit into from
Oct 25, 2020

Conversation

devkapilbansal
Copy link
Member

@devkapilbansal devkapilbansal commented Sep 17, 2020

Description

Fixed issue when pip package manager related commands raise errors.

Fixes #664

Type of Change:

  • Documentation

Code/Quality Assurance Only

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Run python run.py.
  • Run python -m unittest discover tests

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • Update requirements.txt

Code/Quality Assurance Only

  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@devkapilbansal
Copy link
Member Author

devkapilbansal commented Sep 17, 2020

@PrashanthPuneriya I removed some dependencies from requirements. Also, after researching I found that "ensure_str" was included in six==1.12.0. This issue may be due to old virtualenv. This issue was introduced in virtualenv==20.0.0.

I tested it with the same configuration provided by you.

@codecov
Copy link

codecov bot commented Sep 17, 2020

Codecov Report

Merging #877 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #877   +/-   ##
========================================
  Coverage    95.99%   95.99%           
========================================
  Files           96       96           
  Lines         5287     5287           
========================================
  Hits          5075     5075           
  Misses         212      212           

Copy link
Contributor

@SanketDG SanketDG left a comment

Choose a reason for hiding this comment

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

Looks great, I am pretty sure we can do a more extensive audit and remove many more dependencies.

@devkapilbansal devkapilbansal changed the title Fix: Fixxed issue #664 Fix: Fixed issue #664 Sep 17, 2020
@devkapilbansal
Copy link
Member Author

Yes, @SanketDG in my opinion it's never a good choice to copy whole pip freeze to requirements file as some versions can cause issues later

Copy link
Contributor

@PrashanthPuneriya PrashanthPuneriya left a comment

Choose a reason for hiding this comment

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

Changing the requirements.txt gives following compatabiltiy issues:-
image
Though I get the compatability issues. It works fine :)

I found that "ensure_str" was included in six==1.12.0.

But, we still do I have six==1.11.0 in the requirements.txt file right? Though this fixed the issue I still don't have any idea why it did. Can you please explain?

@devkapilbansal
Copy link
Member Author

devkapilbansal commented Sep 18, 2020

While installing we have to use url-resolver, that will be taken into effect from October, 2020. Also, there were some dependencies and we don't need to manage their versions. I removed those dependencies so that pip can install the most updated version automatically.
By letting pip choose the version for those dependencies, the issue got fixed.

@devkapilbansal
Copy link
Member Author

@PrashanthPuneriya I will remove this conflicts soon.

@PrashanthPuneriya
Copy link
Contributor

While installing we have to use url-resolver, that will be taken into effect from October, 2020. Also, there were some dependencies and we don't need to manage their versions. I removed those dependencies so that pip can install the most updated version automatically.
By letting pip choose the version for those dependencies, the issue probably got fixed.

Okay! But, what change has exactly solved this issue?
@SanketDG Is this PR valid since, it solves more than(to my knowledge) what the issue has stated?

@devkapilbansal
Copy link
Member Author

This issue arises due to dependencies of awsebcli that were included in requirements. I removed those dependencies only.

@devkapilbansal
Copy link
Member Author

@PrashanthPuneriya compatibility issues are solved now.

ravi5175
ravi5175 previously approved these changes Sep 18, 2020
@devkapilbansal
Copy link
Member Author

devkapilbansal commented Sep 19, 2020

@SanketDG @PrashanthPuneriya can you please review it once?

SanketDG
SanketDG previously approved these changes Sep 19, 2020
Copy link
Contributor

@SanketDG SanketDG 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 to me, I guess you could remove many more packages

Pinging @PrashanthPuneriya to see if this is okay to go ahead with

README.md Outdated Show resolved Hide resolved
@devkapilbansal
Copy link
Member Author

Looks good to me, I guess you could remove many more packages

Pinging @PrashanthPuneriya to see if this is okay to go ahead with

@PrashanthPuneriya already open a new issue for that. If someone don't solve it then I will remove and update the dependencies. Here, I focus only on those that might create a problem for six

Copy link
Contributor

@PrashanthPuneriya PrashanthPuneriya left a comment

Choose a reason for hiding this comment

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

LGTM! I have tested this locally and it works as expected. Haven't encountered any issues. We can go ahead with this.
With this PR we have fixed all the errors we used to encounter while setting up the project @SanketDG @isabelcosta :)
Thanks a lot for your contribution @KapilBansal320 :)

README.md Outdated Show resolved Hide resolved
@SanketDG
Copy link
Contributor

SanketDG commented Sep 21, 2020

Feel free to change the commit message and PR title to something more explanatory

We have a Commit Message Style Guide

@devkapilbansal devkapilbansal changed the title Fix: Fixed issue #664 fix: Fixed dependency issue that causes pip command to raise error Sep 21, 2020
@devkapilbansal
Copy link
Member Author

@PrashanthPuneriya @SanketDG I made the necessary changes as asked.

Copy link
Contributor

@PrashanthPuneriya PrashanthPuneriya left a comment

Choose a reason for hiding this comment

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

LGTM!

SanketDG
SanketDG previously approved these changes Sep 23, 2020
@devkapilbansal
Copy link
Member Author

@isabelcosta Please review it

@SanketDG
Copy link
Contributor

are the README changes needed?

I honestly don't think so, given just suggesting pip install -U virtualenv does not work at all on most systems because of pip being installed as a system library. Please correct me if I am wrong.

@devkapilbansal
Copy link
Member Author

devkapilbansal commented Sep 26, 2020

I honestly don't think so, given just suggesting pip install -U virtualenv does not work at all on most systems because of pip being installed as a system library. Please correct me if I am wrong.

@SanketDG the problem occurs in old versions of virtualenv. If we are proceeding by making virtualenv first (as explained in docs), then why pip install -U virtualenv will not work. Also, can you please explain what you mean by

pip being installed as a system library
If README changes still seems unnecessary, then I will revert them.

@SanketDG
Copy link
Contributor

Also, can you please explain what you mean by

That pip is installed generally as root, so if you are not the root user, you have to use sudo.

@devkapilbansal
Copy link
Member Author

That pip is installed generally as root, so if you are not the root user, you have to use sudo.
Then pip may not work for installing dependencies too. 🤔

@SanketDG
Copy link
Contributor

Then pip may not work for installing dependencies too.

No, because then you'd be already inside the virtualenv, right?

@devkapilbansal
Copy link
Member Author

devkapilbansal commented Sep 26, 2020

Okay @SanketDG should I remove changes in README.md?? Although this is not only for Linux and they may use sudo if needed while updating virtualenv

@SanketDG
Copy link
Contributor

I think the code block changes are good, just remove the installation step

Fixed issue when pip package manager related commands raises error

Updated the documentation

Fixes #664
@devkapilbansal
Copy link
Member Author

I think the code block changes are good, just remove the installation step

@SanketDG changes done now.

Copy link
Member

@vj-codes vj-codes left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

Copy link
Contributor

@SanketDG SanketDG 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!

@vj-codes vj-codes added the Status: Needs Testing Work has been reviewed and needs the code tested by the quality assurance team. label Sep 27, 2020
@devkapilbansal
Copy link
Member Author

devkapilbansal commented Oct 21, 2020

@PrashanthPuneriya can you please test and verify that the pip dependency issues are solved now. Once it is done we can move it to ready to merge

@PrashanthPuneriya
Copy link
Contributor

Tested locally and haven't encountered any dependency issues or any other issues. It is safe to merge this PR.

@PrashanthPuneriya PrashanthPuneriya added Status: Ready to Merge Work has been tested and needs a final review and merge from a repo maintainer. and removed Status: Needs Testing Work has been reviewed and needs the code tested by the quality assurance team. labels Oct 21, 2020
@isabelcosta isabelcosta temporarily deployed to ms-backend-review-pr-877 October 25, 2020 00:05 Inactive
Copy link
Member

@isabelcosta isabelcosta left a comment

Choose a reason for hiding this comment

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

good work @devkapilbansal !
I deployed this to a Heroku link and this worked fine 🎉

@isabelcosta isabelcosta merged commit 0efacf9 into anitab-org:develop Oct 25, 2020
@devkapilbansal devkapilbansal deleted the issues/664 branch October 25, 2020 04:42
b-thebest pushed a commit to b-thebest/mentorship-backend that referenced this pull request Mar 2, 2021
RiddhiAthreya pushed a commit to RiddhiAthreya/mentorship-backend that referenced this pull request Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Ready to Merge Work has been tested and needs a final review and merge from a repo maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: pip package manager related commands raises error
6 participants