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

Pin core dependencies #185

Open
gsilvapt opened this issue Sep 29, 2020 · 8 comments
Open

Pin core dependencies #185

gsilvapt opened this issue Sep 29, 2020 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Hacktoberfest free-for-all!

Comments

@gsilvapt
Copy link

To make builds more reproducible, as well as errors, please specify the Python version you guys are supporting also lock the versions of your requirement files you guys created.

You're following a not very traditional approach to the requirements, by the way.. It should be something like:

requirements.txt -> contains the requirements to have the application running.
requirements_dev.txt -> contains developer-specific requirements like test suites and others alike.
requirements_prod.txt -> contains production-specific requirements if you have those.

Otherwise, it will be really hard to tackle issues like #184

@andrewgy8
Copy link
Contributor

andrewgy8 commented Sep 29, 2020

Hi @gsilvapt ! Thanks for checking us out.

lock the versions of your requirement files

Do you mean using something like Pipenv?

What do you mean by specify the python version? We have specified which versions we support in the setup.py and include in our CI, but we don't require a particular python version. That is up to the user to decide in his/her application.

As far as the requirements files go, we have split the requirements following a similar pattern. Is there a benefit that we have overlooked that the specific naming you mention provides? I have not heard of any traditional approach like your example.

Thanks

@gsilvapt
Copy link
Author

Do you mean using something like Pipenv?

No, I meant the versions you are using your project as dependencies. The requirements file, should mention what versions of the packages you are using. Otherwise things will break and it will be very hard to know the reason.

What do you mean by specify the python version? We have specified which versions we support in the setup.py and include in our CI, but we don't require a particular python version. That is up to the user to decide in his/her application.

There are some changes between Python 3.6 all the way through 3.8. I guess specifying the supported versions would be a plus.

As far as the requirements files go, we have split the requirements following a similar pattern. Is there a benefit that we have overlooked that the specific naming you mention provides? I have not heard of any traditional approach like your example.

I guess the only advantage would be convention and simplicity. There's a base requirement file that is empty, so...

@andrewgy8
Copy link
Contributor

I guess specifying the supported versions would be a plus.

How about on the README?

There's a base requirement file that is empty

Yeah its empty except for a period. That period is actually a cool feature which allows you to define the requirements in the setup.py but still allow you to install from pip. Its a way to remain DRY in a python project where your requirements maybe defined twice.

@gsilvapt
Copy link
Author

gsilvapt commented Sep 29, 2020

How about on the README?

Yes, sorry, I skipped that for some reason 😃

Yeah its empty except for a period. That period is actually a cool feature which allows you to define the requirements in the setup.py but still allow you to install from pip. Its a way to remain DRY in a python project where your requirements maybe defined twice.

Cool 😄

@andrewgy8
Copy link
Contributor

The requirements file, should mention what versions of the packages you are using.

I do think this is a valid point though. And I will leave the issue open for discussion on this. Its a tough call.

As maintainers, you dont want to restrict users on what they use on their projects. For example, if we say we only support Django <3.0 and someone wants to use Django 4.0, should Relé stand in the way of that?

However, I have heard some people wanting pinned versions in Relé. And I understand this, since you dont really want to mess around with Google sub dependencies, and get a nice suprise one day. (like we did with google pubsub >2.0)

@andrewgy8
Copy link
Contributor

After writing this, then I dont see why we cant pin core dependencies (google-auth and google-pubsub) and leave unrelated stuff like Django, Flask, etc. unpinned.

@andrewgy8 andrewgy8 added enhancement New feature or request hacktoberfest Hacktoberfest free-for-all! good first issue Good for newcomers labels Sep 29, 2020
@gsilvapt
Copy link
Author

For me, it really depends on how you guys are using this.

The idea is to not block future versions or block people from using more recent versions. The goal is to avoid these surprises and also to make environments reproducible. If we're working on the same issue and I'm on Django 3 but you are on 4, there's so many variables that stake that could justify stuff going wrong.

If you are proactively using and maintaining this tool, then you should have an internal updating policy, and update requirements versions every now and then. That's what I observe in solid projects, I'm not trying to say it is the only approach :) I do feel that it brings the best of both worlds to a project - reproducibility, and keeping things up to date.

But, ultimately, this is your project and this is just a suggestion from a guy on the internet 😀

@andrewgy8
Copy link
Contributor

No worries, we always appreciate the input!

Just looking at some other popular projects out there, it seems like they mostly "soft" pin their core dependencies.

@andrewgy8 andrewgy8 changed the title Specify Python version and lock versions for reference Pin core dependencies Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Hacktoberfest free-for-all!
Projects
None yet
Development

No branches or pull requests

2 participants