Skip to content

'user' is not a Python3 package #778

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

Closed
camilonova opened this issue Nov 23, 2018 · 9 comments
Closed

'user' is not a Python3 package #778

camilonova opened this issue Nov 23, 2018 · 9 comments
Labels
bug Something isn't working

Comments

@camilonova
Copy link

In Python2 'user' was a package, but not anymore in Python3.

Seems you are using it as a python package:
https://github.com/timothycrosley/isort/blob/develop/isort/settings.py#L99

It is somehow related to: pylint-dev/pylint#2532

Thank you.

@camilonova
Copy link
Author

@jdufresne Hi there. Can you take a look into it?

@istommao
Copy link

istommao commented Jan 22, 2019

I have the same error @jdufresne

@camilonova
Copy link
Author

@timothycrosley can you? This is just really annoying and seems to be a quick fix.

@istommao
Copy link

@timothycrosley
I agree with @camilonova. pylint use isort, the inspect really annoying!

@hugovk
Copy link
Contributor

hugovk commented Mar 10, 2019

What is the quick fix?

user cannot be removed from the list because the README says isort:

requires Python 3.4+ to run but supports formatting Python 2 code too.

Does isort know which Python versions it is targetting? (Not the version it is running on.)

If it does, we could split known_standard_library into three:

  • known_standard_library
  • known_standard_py2_library
  • known_standard_py3_library

And then join together the lists for targetted versions. (This could be more nuanced, for libraries added and removed between 3.x minor versions.)

But I don't think isort knows or makes any assumptions which versions are targetted. Should that be added?

For comparison, Black has a --target-version option which defaults to detecting on a per-file basis: https://github.com/ambv/black#command-line-options

@timothycrosley timothycrosley added the enhancement New feature or request label Mar 11, 2019
@timothycrosley
Copy link
Member

I think the only fix for this is the --target-version. @hugovk is mentioning, it is not quick, but shouldn't be too difficult either.

Thanks!

~Timothy

@camilonova
Copy link
Author

Python 3.4 should hit EOL in a few days https://devguide.python.org/#branchstatus

Removing it should be the quick fix, right?

You can see also IATI/pyIATI#300 (comment)

@timothycrosley
Copy link
Member

@camilonova

touche.

My concern wasn't about Python3, but Python2.7 which isort will support till at least it's EOL, however looking at it more:

https://docs.python.org/2/library/user.html?highlight=user#module-user

on the 2 side its:

Deprecated since version 2.6: The user module has been removed in Python 3.

I'll make a release to remove user.

Thanks!

~Timothy

@timothycrosley
Copy link
Member

The removal of user has been moved into the develop branch. I plan on making a release on or shortly after Python3.4's end of life that includes this change.

Thanks!

~Timothy

timothycrosley added a commit that referenced this issue Mar 24, 2019
Fix issue #778, deprecating Python3.4 support - starting with removal…
timothycrosley added a commit that referenced this issue Mar 25, 2019

Verified

This commit was signed with the committer’s verified signature. The key has expired.
danielleadams Danielle Adams
Fix issue #778, deprecating Python3.4 support - starting with removal…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants