Coder Social home page Coder Social logo

Comments (10)

kennethreitz avatar kennethreitz commented on May 19, 2024 1

requrements.txt is for bootstrapping environments (e.g. with pinned dependencies), setup.py is for installing packages — they are separate tools for separate tasks.

You are certainly free to merge them for your own needs, but this repo won't do that.

from setup.py.

kennethreitz avatar kennethreitz commented on May 19, 2024 1

like i said, I've done it before :)

from setup.py.

webknjaz avatar webknjaz commented on May 19, 2024 1

@rochacbruno take a look at pbr if you need this, but you should first consider having a single place of requirements, if you need to group optional requirements in distribution package, there's extras_require for this purpose.

from setup.py.

sebastianneubauer avatar sebastianneubauer commented on May 19, 2024

This is a pretty crucial feature. As we all know, pip is not perfect at dependency resolution. Therefore, for serious workflows one needs to be able to parse and resolve the requirements with external tools like pip-tools, especially pip-compile. For this workflow, having a requirements file which is only parsed by setup.py is extremely usefull...

from setup.py.

kennethreitz avatar kennethreitz commented on May 19, 2024

This is not considered good practice. I've done it in a few projects, but got yelled at for it.

from setup.py.

rochacbruno avatar rochacbruno commented on May 19, 2024

@kennethreitz so it is better practice to maintain a duplicated requirements list? one on setup.py and other on requirements.txt to enable the tools mentioned above?

from setup.py.

ofek avatar ofek commented on May 19, 2024

I know this is closed but just so everyone knows: the current best practice it to put -e . at the top of requrements.txt. From https://caremad.io/posts/2013/07/setup-vs-requirement/

https://github.com/ofek/hatch does this for new projects by default

from setup.py.

kennethreitz avatar kennethreitz commented on May 19, 2024

Agreed, if that is your desired behavior.

from setup.py.

webknjaz avatar webknjaz commented on May 19, 2024

@ofek I think it is only good for application projects, which are meant to be installed in --editable mode in production. I wouldn't recommend it for library packages, nor I recommend mixing setup.py with requirements.txt. They've got different purposes of existence. If you want to freeze versions of sub-dependencies, consider using --constraints pip command-line argument, so you won't mix them with real requirements.

from setup.py.

kennethreitz avatar kennethreitz commented on May 19, 2024

agreed with @webknjaz

from setup.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.