Skip to content

some dependencies should be added in configuration files #8692

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

Closed
yuluc123 opened this issue Nov 17, 2021 · 9 comments · Fixed by #8712
Closed

some dependencies should be added in configuration files #8692

yuluc123 opened this issue Nov 17, 2021 · 9 comments · Fixed by #8712

Comments

@yuluc123
Copy link

Details

I notice that there are several dependencies are missing in configuration files. they are:

  • gitdb
  • requests_oauthlib
  • invoke
  • django_cors_headers
  • azure_common

They are used in source code. For example, gitdb is used in readthedocs/vcs_support/backends/git.py

Expected Result

It is necessary to add direct dependencies into configuration files.

@astrojuanlu
Copy link
Contributor

Hi @yuluc123 , when you say configuration files, you mean our various requirements/*.txt files we use to install dependencies for development and production?

@stsewd
Copy link
Member

stsewd commented Nov 17, 2021

  • gitdb is an implicit dep from gitpython, I think it's fine having gitpython manage that (we only import that module for a hack/optimization over gitpython)
  • invoke isn't used in the rtd codebase, but on separate scripts, and it's on https://github.com/readthedocs/common/blob/main/dockerfiles/requirements.txt (that repo is a submodule on this repo)
  • requests_oauthlib no idea from where that dep comes from
  • django_cors_headers, didn't find any import from this, but if you mean this
    django-cors-middleware==1.4.0 # pyup: ignore
    , then it's already on our requirements.
  • azure_common, we don't use azure in production anymore, we use aws.

@yuluc123
Copy link
Author

Hi @astrojuanlu I mean that if the dependency is directly used in code files, it should be declared. For example, if the dependency is used for development, maybe it can be declared in requirements-dev.txt?

@yuluc123
Copy link
Author

yuluc123 commented Nov 18, 2021

Thanks to your reply. Here are my some opinions.

  • requests_oauthlib is used in readthedocs/oauth/services/base.py in line 12?
  • django-cors-headers is used in readthedocs/core/signals.py in line 8?

Sorry to bother you.

@astrojuanlu
Copy link
Contributor

from requests_oauthlib import OAuth2Session

from corsheaders import signals

@astrojuanlu
Copy link
Contributor

I mean that if the dependency is directly used in code files, it should be declared.

Totally agree with you @yuluc123 👍🏽 Looks like we can be more explicit or do some cleanup.

@humitos
Copy link
Member

humitos commented Nov 24, 2021

I'm a little lost here 😅 . What are the explicit actions required?

@astrojuanlu
Copy link
Contributor

We have 2 undeclared dependencies, that I assume get installed because they are transitive dependencies of something else: requests_oauthlib and django_cors_headers. We should explicitly list them in our requirements. Besides, we can remove azure_common.

@humitos
Copy link
Member

humitos commented Nov 24, 2021

  • I added requests-oauthlib.
  • corsheaders is already declared, it comes from django-cors-middleware
  • I didn't find anything related to azure_common

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 a pull request may close this issue.

4 participants