Git Product home page Git Product logo

Comments (5)

tddschn avatar tddschn commented on June 18, 2024

Hey thanks for filing the issue!

I was aware of this and choose not to support many (or most) of the requirement.txt spec, because

  • I did not find an easy way to support them (I think pip itself only offers an easy-to-use installation API, how the file is parse is internal to pip and undocumented. Actually, the pip install command uses internal APIs, I don't think using pip as a lib is recommended).
  • I have limited time and only made what was needed for my use cases.

Please feel free to suggest ideas to support this, or open a PR. :)

from poetry-add-requirements.txt.

tddschn avatar tddschn commented on June 18, 2024

Please update the tool to v1.1.4 and try again. :)

from poetry-add-requirements.txt.

kb- avatar kb- commented on June 18, 2024

The new version just ignores the # and therefore treats comments as modules to install.

I would do this:

utils.py

def preprocess_line(line: str) -> str:
    return line.split('#')[0].strip()  # Remove comments and leading/trailing whitespace

from poetry-add-requirements.txt.

tddschn avatar tddschn commented on June 18, 2024

@kb- Thanks for the suggestion.

I just tested how pip 23.2.1 treats comments, and I think it ignores comment lines.

Is there any source that supports this?

The new version just ignores the # and therefore treats comments as modules to install

from poetry-add-requirements.txt.

tddschn avatar tddschn commented on June 18, 2024

I found the requirements-parser project also just ignore lines that start with '#', see https://sourcegraph.com/github.com/madpah/requirements-parser/-/blob/requirements/parser.py?L62=

I think I'm gonna do just that. :)

Update: implemented in v1.4.0

from poetry-add-requirements.txt.

Related Issues (3)

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.