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 the python virtualenv for development #1513

Open
Zlopez opened this issue Dec 1, 2022 · 7 comments · May be fixed by #1748
Open

Fix the python virtualenv for development #1513

Zlopez opened this issue Dec 1, 2022 · 7 comments · May be fixed by #1748
Assignees
Labels
Low Priority This ticket has a low priority type.dev Development related change

Comments

@Zlopez
Copy link
Contributor

Zlopez commented Dec 1, 2022

The contribution guide for python virtualenv currently doesn't work. When trying to follow step poetry run python createdb.py we get following:

[anitya.config INFO] The Anitya configuration file, /etc/anitya/anitya.toml, does not exist.                                                                                                                                                  
[anitya.config WARNING] SECRET_KEY is not configured, falling back to the default. This is NOT safe for production deployments!                                                                                                               
/var/home/zlopez/git/anitya/anitya/lib/versions/rpm.py:49: UserWarning: Failed to import 'rpm', emulating RPM label comparisons                                                                                                               
  warnings.warn("Failed to import 'rpm', emulating RPM label comparisons")                                                                                                                                                                    
Traceback (most recent call last):                                                                                                                                                                                                            
  File "/var/home/zlopez/git/anitya/createdb.py", line 12, in <module>                                                                                                                                                                        
    from anitya.app import create                                                                                                                                                                                                             
  File "/var/home/zlopez/git/anitya/anitya/app.py", line 27, in <module>                                                                                                                                                                      
    from anitya.db import Session, initialize as initialize_db, models                                                                                                                                                                        
  File "/var/home/zlopez/git/anitya/anitya/db/__init__.py", line 25, in <module>                                                                                                                                                              
    from .models import (  # noqa: F401                                                                                                                                                                                                       
  File "/var/home/zlopez/git/anitya/anitya/db/models.py", line 39, in <module>                                                                                                                                                                
    from anitya.lib.plugins import ECOSYSTEM_PLUGINS, BACKEND_PLUGINS, VERSION_PLUGINS                                                                                                                                                        
  File "/var/home/zlopez/git/anitya/anitya/lib/plugins.py", line 25, in <module>                                                                                                                                                              
    from anitya.lib.backends import BaseBackend                                                                                                                                                                                               
  File "/var/home/zlopez/git/anitya/anitya/lib/backends/__init__.py", line 33, in <module>                                                                                                                                                    
    import pkg_resources                                                                                                                                                                                                                      
ModuleNotFoundError: No module named 'pkg_resources'   

This is probably caused by moving from setuptools to poetry, because this module is part of setuptools, which are no longer installed with Anitya. It seems that pkg_resources are used only to get current Anitya version for HTTP header. This could be easily fixed by reading the version directly from anitya.__version__ .

@Zlopez Zlopez added type.dev Development related change Low Priority This ticket has a low priority labels Dec 1, 2022
@anshikavashistha
Copy link

May I work on this issue @Zlopez ?

@Zlopez
Copy link
Contributor Author

Zlopez commented Mar 19, 2024

@anshikavashistha Feel free to take the issue or I can assign it to you, if you can't do it by yourself.

As this is an old ticket, it would be best to first check if the issue is still there.

@anshikavashistha
Copy link

@Zlopez Sure I would like to try it by myself
Thank you

@anshikavashistha
Copy link

I had tried but I am not able to assign it to me. If possible, please assign it to me.

@anshikavashistha
Copy link

anshikavashistha commented Mar 22, 2024

a1
@Zlopez I was following this guide for the installation. This is the error which I was getting .

@Zlopez
Copy link
Contributor Author

Zlopez commented Mar 25, 2024

It seems that there are still some issues, just different. Feel free to play with it and get it running.

@anshikavashistha anshikavashistha linked a pull request Mar 26, 2024 that will close this issue
@anshikavashistha
Copy link

@Zlopez May be this will work it out ?
Please review and suggest the required changes

@Zlopez Zlopez linked a pull request Mar 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Low Priority This ticket has a low priority type.dev Development related change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants