Re: Python enable dependency generator problem

2023-10-11 Thread Adam Williamson
On Wed, 2023-10-11 at 09:31 -0300, Priscila Gutierres wrote:
> Thank you,
> It works removing -t from %pyproject_buildrequires, EXCEPT if I keep all
> the pytest tests running
> When running the test, it blames about the modules needed for the tests, as
> you can see here: https://paste.centos.org/view/5f0e107a
> Deleting line 61 here: https://paste.centos.org/view/c25fee49, everything
> works as expected +_+

Well, yes, that's...expected. Removing -t means you're not generating
automatic build dependencies for the test suite, so the things the test
suite needs don't get installed.

As I said in my mail, if you want to run the tests - which you should!
- you either need to get upstream to make its dependency version
specifiers looser, patch them downstream before the dependency
generator runs, or don't use the dependency generator but specify the
BuildRequires manually based on the text file.
-- 
Adam Williamson (he/him/his)
Fedora QA
Fedora Chat: @adamwill:fedora.im | Mastodon: @ad...@fosstodon.org
https://www.happyassassin.net



___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Python enable dependency generator problem

2023-10-11 Thread Maxwell G
On Wed Oct 11, 2023 at 09:31 -0300, Priscila Gutierres wrote:
> Thank you,
> It works removing -t from %pyproject_buildrequires, EXCEPT if I keep all
> the pytest tests running
> When running the test, it blames about the modules needed for the tests, as
> you can see here: https://paste.centos.org/view/5f0e107a

That's because you didn't add (automatic or otherwise) BuildRequires for
the test dependencies.

> Deleting line 61 here: https://paste.centos.org/view/c25fee49, everything
> works as expected +_+

That's very much the wrong solution. Unless the test suite is something
kooky, you ought to run it in %check during the RPM build.
If the test suite indeed cannot be run due to dependency on network
access or a system service or a similar reason,
you should use %py3_check_import / %pyproject_check_import.


-- 
Maxwell G (@gotmax23)
Pronouns: He/They
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Python enable dependency generator problem

2023-10-11 Thread Priscila Gutierres
Thank you,
It works removing -t from %pyproject_buildrequires, EXCEPT if I keep all
the pytest tests running
When running the test, it blames about the modules needed for the tests, as
you can see here: https://paste.centos.org/view/5f0e107a
Deleting line 61 here: https://paste.centos.org/view/c25fee49, everything
works as expected +_+



On Tue, Oct 10, 2023 at 7:33 PM Miro Hrončok  wrote:

> On 10. 10. 23 23:14, Adam Williamson wrote:
> > If you*want*  to auto-generate these requirements, your only options
> > are to get upstream to loosen the version specifiers, or patch the
> > requirements file in %prep before the build requirement generator runs
> > (I think that ordering is possible).
>
> Not only it is possible, but it *is* the order in which the build will
> always
> run (%prep before %generate_buildrequires) regardless of the order in the
> specfile. Putting it in any other order in the specfile is possible but
> confusing.
>
> --
> Miro Hrončok
> --
> Phone: +420777974800
> IRC: mhroncok
> ___
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> Fedora Code of Conduct:
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
> Do not reply to spam, report it:
> https://pagure.io/fedora-infrastructure/new_issue
>
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Python enable dependency generator problem

2023-10-10 Thread Miro Hrončok

On 10. 10. 23 23:14, Adam Williamson wrote:

If you*want*  to auto-generate these requirements, your only options
are to get upstream to loosen the version specifiers, or patch the
requirements file in %prep before the build requirement generator runs
(I think that ordering is possible).


Not only it is possible, but it *is* the order in which the build will always 
run (%prep before %generate_buildrequires) regardless of the order in the 
specfile. Putting it in any other order in the specfile is possible but confusing.


--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Python enable dependency generator problem

2023-10-10 Thread Adam Williamson
On Tue, 2023-10-10 at 17:30 -0300, Priscila Gutierres wrote:
> Hello,
> 
> I'm trying to add python enable dependency generator on python-pymemcache,
> but when adding it to the specfile, it asks for some old version of some
> needed packages:
> https://paste.centos.org/view/33623ed7
> 
> Fedora repos have a more updated version, but this dependency generator is
> asking for an older version of those packages:
> 
> https://src.fedoraproject.org/rpms/python-faker
> https://src.fedoraproject.org/rpms/python-gevent
> https://src.fedoraproject.org/rpms/python-pylibmc
> 
> 
> How to fix this?

Did you include the `-t` arg for the generator?
`%pyproject_buildrequires -t`?

If so, it'll be pulling these dependencies from tox.ini, which pulls
them from
https://github.com/pinterest/pymemcache/blob/master/test-requirements.txt
, which pins very specific versions.

If you *want* to auto-generate these requirements, your only options
are to get upstream to loosen the version specifiers, or patch the
requirements file in %prep before the build requirement generator runs
(I think that ordering is possible).

Alternatively of course you can omit `-t` so the dependency generator
won't work out the requirements from tox.ini , but then you can't run
the tests during %check unless you specify the requirements manually...
-- 
Adam Williamson (he/him/his)
Fedora QA
Fedora Chat: @adamwill:fedora.im | Mastodon: @ad...@fosstodon.org
https://www.happyassassin.net



___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Python enable dependency generator problem

2023-10-10 Thread Ben Beasley
It looks like you are using “%pyproject_buildrequires -t”, and upstream’s 
tox.ini gets its dependencies from the file test-requirements.txt, which pins 
exact versions of everything (==). Obviously, it’s very rare that this will 
line up with the versions packaged in Fedora. If you’re going to use that file, 
you’ll need to patch it in %prep to remove the version pins, or at least 
convert them to lower bounds (s/==/>=) if that seems appropriate. You should 
also patch out the dependency on pytest-cov 
(https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters).

If that all gets too messy, a less satisfying but more straightforward 
alternative would be to eschew tox, maintain the list of BR’s for the tests 
manually in the spec file the old-fashioned way, and run the tests with %pytest 
instead of %tox.

On Tue, Oct 10, 2023, at 4:30 PM, Priscila Gutierres wrote:
> Hello, 
>
> I'm trying to add python enable dependency generator on 
> python-pymemcache, but when adding it to the specfile, it asks for some 
> old version of some needed packages:
> https://paste.centos.org/view/33623ed7 
>
> Fedora repos have a more updated version, but this dependency generator 
> is asking for an older version of those packages:
>
> https://src.fedoraproject.org/rpms/python-faker
> https://src.fedoraproject.org/rpms/python-gevent
> https://src.fedoraproject.org/rpms/python-pylibmc
>
>
> How to fix this?
>
>
> Priscila.
> ___
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
> Do not reply to spam, report it: 
> https://pagure.io/fedora-infrastructure/new_issue
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue