Work on upstream python-nitrate project [1] to make the python3 compatible code. [1] https://github.com/psss/python-nitrate
Let me know if you need any help with porting the stack to Python 3. Today, I've installed 1minute tip on Fedora 30 and from the list of new packages in my system, it's obvious that we need to move this forward.
The process to test python-nitrate in a virtual environment seems to work so I can help you with porting. Note that I needed to install libpq-devel which provides pg_config utility. I'm going to start from your branch where a lot is done.
By the way, the reason we cannot just alter PYTHONPATH and use nitrate module without installation is that the package folder name is `source` instead of `nitrate` and it's renamed only during the installation. The same reason prevents us from doing `pip install --editable`. It would be good to rename the folder.
I've finished the initial phase of porting and the basic test described in comment#5 is working with both Python 2 and 3. Pull request is here: https://github.com/ZelenyMartin/python-nitrate/pull/2 What next should I test and port?
By the way, the package has been retired: https://bugzilla.redhat.com/show_bug.cgi?id=1754904
Merged Lumír's work into my fork. Obtaining TCMS permissions for him in progress. Current issues in tests (Python3): File "/home/mzeleny/.virtualenvs/python-nitrate/lib/python3.7/site-packages/nitrate/mutable.py", line 1445, in _fetch testplan, testcase = _idify(self.id) ValueError: too many values to unpack (expected 2) and File "/home/mzeleny/.virtualenvs/python-nitrate/lib/python3.7/site-packages/nitrate/containers.py", line 782, in __iter__ self._items, key=lambda x: self._object.sortkey(x)): TypeError: '<' not supported between instances of 'NoneType' and 'int' and File "/home/mzeleny/.virtualenvs/python-nitrate/lib/python3.7/site-packages/nitrate/base.py", line 371, in __eq__ self.__class__.__name__, other.__class__.__name__)) nitrate.xmlrpc_driver.NitrateError: Cannot compare 'User' with 'str' Work in progress...
With the latest PR I've just open (https://github.com/ZelenyMartin/python-nitrate/pull/3), I have only these errors: Traceback (most recent call last): File "source/tests.py", line 1387, in test_bugging3 self.assertTrue(self.bug not in testcase.bugs) AssertionError: False is not true Traceback (most recent call last): File "source/tests.py", line 1217, in test_sortkey_update caseplan.sortkey = sortkey File "/home/lbalhar/.virtualenvs/nitrate/lib/python3.7/site-packages/nitrate/base.py", line 83, in setter self._fetch() File "/home/lbalhar/.virtualenvs/nitrate/lib/python3.7/site-packages/nitrate/mutable.py", line 1445, in _fetch testplan, testcase = _idify(self.id) ValueError: too many values to unpack (expected 2) Traceback (most recent call last): File "source/tests.py", line 1768, in test_add_remove self.assertTrue(testcase in testrun.testcases) AssertionError: False is not true The latest one happens with Python 2 as well. I cannot track the problem because the structure of classes is very complicated. Let me know if you need any more help.
Any news here? We should finish it asap to bring this package back to Fedora.
Solved one issue by commit [1] Current state: one assert fails in test File "source/tests.py", line 1768, in test_add_remove self.assertTrue(testcase in testrun.testcases) AssertionError: False is not true [1] https://github.com/ZelenyMartin/python-nitrate/commit/3a603b9fff48827c93358463b7ab212346e2b5e8
This message is a reminder that Fedora 29 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '29'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 29 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Current state is that test suite is without error and is able to run both under python3 and python2. I made PR to original repo [1] and I'm waiting for Petr Šplichal to check it and possibly merge it. [1] https://github.com/psss/python-nitrate/pull/10
(In reply to Martin Zelený from comment #16) > Current state is that test suite is without error and is able to run both > under python3 and python2. I made PR to original repo ... well ... while at it, could you please also update the specfile and do a scratchbuild, pretty please with sugar on top? :-)
This is my first attempt for scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=38760304
Hm, I found an issue :/ $ cat reproducer.py import nitrate r = nitrate.TestRun(122250) for a in r: print(a) On python2 ... prints On python3 ... Traceback (most recent call last): File "x.py", line 3, in <module> for a in r: File "/usr/local/lib/python3.7/site-packages/nitrate-1.4.1-py3.7.egg/nitrate/mutable.py", line 528, in __iter__ File "/usr/local/lib/python3.7/site-packages/nitrate-1.4.1-py3.7.egg/nitrate/containers.py", line 946, in __iter__ TypeError: '<' not supported between instances of 'NoneType' and 'int' I've installed from Martin's github by `sudo python3 setup.py install` Can you reproduce, @Martin?
I guess it's from missing (None) sortkey in few caseruns as shown by r = nitrate.TestRun(122250) for i in r.caseruns._items: print(i.sortkey) ipdb3 on reproducer.py shows this frame: > /usr/local/lib/python3.7/site-packages/nitrate-1.4.1-py3.7.egg/nitrate/containers.py(946)__iter__() 945 """ Iterate over all included case runs ordered by sortkey """ --> 946 for caserun in sorted(self._items, key=lambda x: x.sortkey): 947 yield caserun
For the record there is change in behaviour: $ python2 -c 'print(None < 1)' True $ python3 -c 'print(None < 1)' Traceback (most recent call last): File "<string>", line 1, in <module> TypeError: '<' not supported between instances of 'NoneType' and 'int'
One of these issues has been already solved in: https://github.com/ZelenyMartin/python-nitrate/commit/480ee7d1e498bcf6b863d1a80bd580d08da3dc7a It's just necessary to apply the same fix for more classes.
(In reply to Martin Zelený from comment #18) > This is my first attempt for scratch build: > https://koji.fedoraproject.org/koji/taskinfo?taskID=38760304 thanks, but I prefer F31 ;-) https://koji.fedoraproject.org/koji/taskinfo?taskID=38773438 it installs, and I can at least import the qe module ... however, any real usage ends in tracebacks :-/
I made another fix with Lumir's help. Check the new scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=38777416
Thanks, I've tried https://github.com/ZelenyMartin/python-nitrate/commit/50794665300014056ddb8f9919c628c46bacf871 and it works. Good job!
Fedora 31 update is ready for testing: https://bodhi.fedoraproject.org/updates/FEDORA-2019-ef25129f44
There's a possible problem with the update: Currently users cannot install both python2-nitrate and python3-nitrate because of the conflicting script and man pages: Error: Transaction check error: file /usr/bin/nitrate from install of python3-nitrate-1.5-2.fc31.noarch conflicts with file from package python2-nitrate-1.4-3.fc31.noarch file /usr/share/man/man1/python-nitrate.1.gz from install of python3-nitrate-1.5-2.fc31.noarch conflicts with file from package python2-nitrate-1.4-3.fc31.noarch There are several solutions for this: 1) Keep it as it is (don't support both versions) 2) Drop nitrate script and man pages from python2-nitrate 3) Create a new subpackage 'nitrate' and move conflicting files there What do you think would be the best way?
IMO Point 3) - move conflicts to nitrate
Take a look on Python RPM Porting guide: https://python-rpm-porting.readthedocs.io/en/latest/#what-type-of-software-are-you-packaging If the application does the same for Python 2 and 3, it should be included only in python3- subpackage, and python2- subpackage will still provide only importable module. I guess that this is the case of nitrate.
Thanks for the feedback. I've updated the spec file accordingly: https://github.com/psss/python-nitrate/commit/cd00d31 Going to submit updates for f30, f31 and f32.
FEDORA-2019-5a454922a5 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-5a454922a5
Fresh rpms are also available in copr: https://copr.fedorainfracloud.org/coprs/psss/python-nitrate/
Hm, bug reload button changed the state to NEW. Returning back.
FEDORA-2019-894e80ab6e has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-894e80ab6e
python-nitrate-1.5-4.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-894e80ab6e
python-nitrate-1.5-4.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.
I'm getting tracebacks in the cache module: > Error in atexit._run_exitfuncs: > Traceback (most recent call last): > File "/usr/lib/python3.7/site-packages/nitrate/cache.py", line 400, in exit > self.save() > File "/usr/lib/python3.7/site-packages/nitrate/cache.py", line 258, in save > self.expire() > File "/usr/lib/python3.7/site-packages/nitrate/cache.py", line 444, in expire > for id, current_object in current_class._cache.iteritems(): > AttributeError: 'dict' object has no attribute 'iteritems' 2to3 also reports deprecated usage of itervalues in the same module. > $ rpm -qf /usr/lib/python3.7/site-packages/nitrate/cache.py > python3-nitrate-1.5-4.fc31.noarch
Should be fixed in https://github.com/psss/python-nitrate/commit/1872217
This message is a reminder that Fedora 31 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '31'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 31 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.