Giter Site home page Giter Site logo

Comments (6)

Bengt avatar Bengt commented on August 18, 2024

Using the setup.cfg at the project root is the pythonic way, but other tools follow other strategies. Note that the quoted pep8 also supports ~/.config/pep8 outing it as a Unix-y/Linux-y tool, nose supports an rc or cfg file at ~ in addition to a section in the setup.cfg. Since some tools that are useful to python projects are not python-specific, other ways are chosen. Travis for example uses a YAML file at the project root in contrast to the ini-style configs of all others. Likewise although being ini-style, Git uses specific files to store some information; the .gitmodules and .gitattributes for example. I think projects may choose different ways of integrating the tools they need and to be as compatible as possible, a tool that aims to be used broadly needs to implement at least a few ways of configuration. Depending on your tools, using only a setup.cfg might be possible, in other cases you will currently end up with various different config files in the project root, not only rc files. In the latter case it might be better to have one config file per tool to at least keep some level of consistency.

from isort.

acdha avatar acdha commented on August 18, 2024

Agreed - as a concrete example, I was thinking it might be nice to collect
this sort of project β€œpolicy” into a single setup.cfg file to reduce the
odds of, say, someone updating the module exclude list for the tool they
use but missing something else. I definitely wouldn't want to lose the
ability for you to have a config file in your home directory with your
personal styles but it makes sense for an open-source project to be able to
override those defaults for consistency.

Chris

from isort.

Bengt avatar Bengt commented on August 18, 2024

True, in an ideal world each project had a single config file, overriding user-level presets. This should be the goal to aim for, but one has to accept the fact that there are other tools with odd ways of configuration. I think at least a a section the setup.cfg at project level and an individual file at project level as well as at the user level should be supported.

from isort.

timothycrosley avatar timothycrosley commented on August 18, 2024

I think this is a good idea, and certainly will add support for it in the next release. Enabling a single project config is really a good goal, and I added editorconfig support for this reason. I think it just makes sense to extend this support to the more pythonic setup.cfg as well, really glad you made me aware of this approach.

Thanks!

~Timothy

from isort.

timothycrosley avatar timothycrosley commented on August 18, 2024

Support for setup.cfg based configuration has been added in release 3.3.0.

Thanks again!

~Timothy

from isort.

acdha avatar acdha commented on August 18, 2024

Awesome, thanks!

from isort.

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.