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(install): Replace platform.dist with distro.linux_distribution for PY3.8+ compatibility #1017

Closed
wants to merge 29 commits into from

Conversation

nikunj1222
Copy link
Contributor

@nikunj1222 nikunj1222 commented Jun 9, 2020

Replace platform.dist() with distro.linux_distribution in install.py | platform.dist() not supported by python3.8

Distro Information (Required)

Python >= 3.5
Ubuntu 20.04 LTS
And for all new distros in future

Possible Solution

To replace Replace platform.dist() with distro.linux_distribution in install.py

Use this module https://github.com/nir0s/distro for getting distro/system verion information.

Install distro module

`
Sudo pip install distro

`

Replace platform.dist() with distro.linux_distribution in install.py | platform.dist() not supported by python3.8


istro Information (Required)

Ubuntu 20.04 LTS
And for all new distros in future

Possible Solution

To replace Replace platform.dist() with distro.linux_distribution in install.py

Use this module https://github.com/nir0s/distro for getting distro/system verion information.

I will try to cook something myself. But I am not a professional programmer. So if anybody can work on this request.
@nikunj1222
Copy link
Contributor Author

The do think now the failure is coming from other dependencies...?

@nikunj1222
Copy link
Contributor Author

#1019 #1019

Should be merged to solved the errors on python 3.7,3.6,3.8

@nikunj1222
Copy link
Contributor Author

#1016 #997
Above issues can be solved with this pull request.

nikunj1222 and others added 4 commits June 10, 2020 13:26
Co-authored-by: Rohan <Alchez@users.noreply.github.com>
Co-authored-by: Rohan <Alchez@users.noreply.github.com>
Changed current_dist = platfor.dist()  TO current_dist = platform.dist()
@gavindsouza gavindsouza changed the title Replace platform.dist() with distro.linux_distribution in install.py fix(install): Replace platform.dist with distro.linux_distribution for PY3.8+ compatibility Jun 10, 2020
…sion of python version

  File "/home/travis/build/frappe/bench/install.py", line 89, in check_distribution_compatibility
    dist_name, dist_version = get_distribution_info()
TypeError: 'NoneType' object is not iterable
nikunj1222 and others added 3 commits June 10, 2020 15:49
Co-authored-by: Rohan <Alchez@users.noreply.github.com>
Co-authored-by: gavin <gavin18d@gmail.com>
@nikunj1222 nikunj1222 requested a review from gavindsouza June 10, 2020 14:55
@nikunj1222
Copy link
Contributor Author

@Alchez @gavindsouza

image

Anybody has any idea why import module distro error ?

Traceback (most recent call last):
File "/home/travis/build/frappe/bench/install.py", line 24, in
install_and_import('distro')
File "/home/travis/build/frappe/bench/install.py", line 22, in install_and_import
globals()[package] = importlib.import_module(package)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
ImportError: No module named distro

def install_and_import(package):
    import importlib
    try:
        importlib.import_module(package)
    except ImportError:
		subprocess.check_call('{0} -m pip install {1}'.format(sys.executable, package))
    finally:
        globals()[package] = importlib.import_module(package)

install_and_import('distro')

Normally this should not cause this error.

Copy link
Collaborator

@gavindsouza gavindsouza left a comment

Choose a reason for hiding this comment

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

Fix indentation and new lines!

Co-authored-by: gavin <gavin18d@gmail.com>
@nikunj1222
Copy link
Contributor Author

Hi guys it seems all checks are passed. Let me know if you need any more changes..

@nikunj1222 nikunj1222 requested a review from gavindsouza June 11, 2020 11:17
@gavindsouza
Copy link
Collaborator

@nikunj1222 sorry we couldn't get this fixed earlier. but #1048 has been merged. Thanks for your contribution.

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