Code Monkey home page Code Monkey logo

Comments (5)

abravalheri avatar abravalheri commented on July 17, 2024

I am on the fence for this one...
Right now validate-pyproject validates the pyproject.toml file itself, in a standalone matter... It does not matter if the user runs the validator from the project directory. If the file does not change, it will keep being valid or invalid, which is consistent and good.

Adding a feature like this means that we validate pyproject.toml + the environment in which it is contained. This is a change in behaviour and the same file can be considered valid and invalid in 2 moments of time, even if the file itself does not change, which is conceptually weird...

from validate-pyproject.

abravalheri avatar abravalheri commented on July 17, 2024

We could, potentially, achieve something with warnings and having a CLI flag to transform warnings in errors, but the warnings module in Python is very limited...

warnings.catch_warnings() is not really thread-safe, there is no way of removing warnings added by warnings.simplefilter without doing a full warnings.resetwarnings (these 2 functions are probably not very thread-safe)...

from validate-pyproject.

marscher avatar marscher commented on July 17, 2024

I agree, that this feels strange from the aspect of validating two different things out of the developer perspective. Out of the users perspective on the other hand it feels strange, that these things are separated.

Sorry, I do not understand why thread safety is a concern here. Is the validation process multi-threaded?

from validate-pyproject.

abravalheri avatar abravalheri commented on July 17, 2024

Sorry, I do not understand why thread safety is a concern here. Is the validation process multi-threaded?

@marscher, validate-pyproject is a library, this means that it can be used in a code that uses multiple threads.

from validate-pyproject.

marscher avatar marscher commented on July 17, 2024

That's a valid point. Although I think it is unlikely that developers will fiddle around with the environment during execution the validation. But it can happen of course. Then it'd be super hard to detect or work around this circumstance.

If this causes too much of an headache, I'd be fine with closing my request.

from validate-pyproject.

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.