Bug 1738165 - system-switch-java depends on Python 2
Summary: system-switch-java depends on Python 2
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: system-switch-java
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: jiri vanek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F31_PY2REMOVAL
TreeView+ depends on / blocked
 
Reported: 2019-08-06 13:19 UTC by Lumír Balhar
Modified: 2019-11-07 10:31 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-07 10:31:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lumír Balhar 2019-08-06 13:19:44 UTC
Python 2.7 will reach end-of-life in January 2020, over 9 years after it was released. This falls within the Fedora 31 lifetime.
Packages that depend on Python 2 are being switched to Python 3 or removed from Fedora: https://fedoraproject.org/wiki/Changes/F31_Mass_Python_2_Package_Removal#Information_on_Remaining_Packages
Python 2 will be retired in Fedora 32: https://fedoraproject.org/wiki/Changes/RetirePython2

To help planning, we'd like to know the plans for system-switch-java's future. Specifically:


- What is the reason for the Python2 dependency? (Is it software written in Python, or does it just provide Python bindings, or use Python in the build system or test runner?) 

- What are the upstream/community plans/timelines regarding Python 3?

- What is the guidance for porting to Python 3? (Assuming that there is someone who generally knows how to port to Python 3, but doesn't know anything about the particular package, what are the next steps to take?)


This bug is filed semi-automatically, and might not have all the context specific to system-switch-java.
If you need anything from us, or something is unclear, please mention it here.

Thank you.

Comment 1 Ben Cotton 2019-08-13 16:55:43 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 2 Ben Cotton 2019-08-13 17:39:58 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 3 Lumír Balhar 2019-08-15 07:41:25 UTC
Please answer the above questions. If you don't, the package can be orphaned: https://fedoraproject.org/wiki/Changes/F31_Mass_Python_2_Package_Removal#Information_on_Remaining_Packages

If you need any information or help, or if you need some more time, please let us know.

Comment 4 Lumír Balhar 2019-08-22 06:58:50 UTC
Please answer the above questions. If you don't, the package can be orphaned: https://fedoraproject.org/wiki/Changes/F31_Mass_Python_2_Package_Removal#Information_on_Remaining_Packages

If you need any information or help, or if you need some more time, please let us know.

Comment 5 Lumír Balhar 2019-08-29 05:19:04 UTC
Please answer the above questions. If you don't, the package can be orphaned: https://fedoraproject.org/wiki/Changes/F31_Mass_Python_2_Package_Removal#Information_on_Remaining_Packages

If you need any information or help, or if you need some more time, please let us know.

Comment 6 Miro Hrončok 2019-09-05 10:41:44 UTC
According to the procedure described in https://fedoraproject.org/wiki/Changes/F31_Mass_Python_2_Package_Removal#Information_on_Remaining_Packages the package was now orphaned. If you think it was a mistake, you can provide the answers and claim the package back.

Let us know if you need any help or just need more time.

Comment 7 Miro Hrončok 2019-10-03 09:35:45 UTC
The package was unorphaned with "We have it fixed now and working on python3" (although there is no fix committed in the package). Do I assume correctly it is a work in progress?

https://pagure.io/releng/issue/8866

Comment 8 Miro Hrončok 2019-10-03 15:16:11 UTC
https://src.fedoraproject.org/rpms/system-switch-java/c/f542eb4bf7035013cbedd4ed69ec41ad9a0cd9ff?branch=master

Now the package requires both:

/usr/bin/python2   - that is Python 2 and hence nothing really changed
python, python-newt, python-gobject-base, python-devel - this is forbidden to use or depend on


Would appreciate if you talk back.

Comment 9 jiri vanek 2019-10-04 15:37:51 UTC
Hi!

yes, it is workin progress in upstream, by other community member then myself. I will patch the RPM fo rnow to sed this out. I thought python2 was completly removed, and thus the build would fail.

Comment 10 jiri vanek 2019-10-04 16:37:14 UTC
done

Comment 11 Miro Hrončok 2019-10-04 19:18:25 UTC
The package still uses forbidden requires on python-* packages and fails to install:

Error: 
 Problem: cannot install the best candidate for the job
  - nothing provides python-gobject-base needed by system-switch-java-1.1.7.2-6.fc32.noarch

Comment 12 Lumír Balhar 2019-10-11 08:02:53 UTC
Here is a PR which fixes the unversioned dependencies: https://src.fedoraproject.org/rpms/system-switch-java/pull-request/2

When I try to run it with no Java installed, it seems to work and it only shows this warning:

/usr/share/system-switch-java/switch_java_functions.py:264: SyntaxWarning: invalid escape sequence \.
  return _get_javadocs_alternatives('javadoczip', '\.zip')

But then I've tried to install Java (java-1.8.0-openjdk) and then the tool ends with error:

# system-switch-java 
Traceback (most recent call last):
  File "/usr/sbin/system-switch-java", line 31, in <module>
    switch_java_boot.main()
  File "/usr/share/system-switch-java/switch_java_boot.py", line 55, in main
    java_identifiers, best_identifier = get_java_identifiers()
  File "/usr/share/system-switch-java/switch_java_functions.py", line 199, in get_java_identifiers
    if len(identifiers_and_jdks) > 0:
TypeError: object of type 'zip' has no len()

With two java runtimes (the previous one and java-11-openjdk), the tool shows me a CLI window with an error message "An attempt to parse /var/lib/alternatives/java failed. 

Let me know if you need any help to fix these issues.

Comment 13 jiri vanek 2019-10-11 08:56:11 UTC
Hi!

Thank you. Merged and build started.
Issue you are describing is known. Friend who was fixing the issue felt unexpectedly sick. feel free to fix the  https://pagure.io/system-switch-java on your own.

Comment 14 Lumír Balhar 2019-10-14 08:36:40 UTC
I am going to take a look at these issues. Please, let me know if there is any work already done so I don't have to reinvent the wheel.

Comment 15 Lumír Balhar 2019-10-14 10:48:17 UTC
Here is a PR which makes this tool Python 3 compatible: https://pagure.io/system-switch-java/pull-request/2

All tests are passing with both Pythons and the tool itself seems to work.

Comment 16 Lumír Balhar 2019-10-17 09:43:44 UTC
PR was merged, could you please rebuild this package?

Comment 17 Lumír Balhar 2019-10-25 09:44:35 UTC
It'll need a new release upstream.

Comment 18 Lumír Balhar 2019-11-07 10:31:12 UTC
Build: https://koji.fedoraproject.org/koji/buildinfo?buildID=1408807


Note You need to log in before you can comment on or make changes to this bug.