Git Product home page Git Product logo

poetry-add-requirements.txt's Introduction

poetry-add-requirements.txt

Add dependencies specified in requirements.txt file(s) to your Poetry project

Features

  • Auto detect charset of requirements.txt file(s) and feed normalized dependency specs to poetry.
  • Stop on first poetry add error.
  • Ignore dependency version requirements specified in requirements.txt file(s).
  • Ignore errors when installing individual dependencies.
  • Pass arbitrary arguments to poetry add after -- at the end of the command.

Installation

pipx

This is the recommended installation method.

$ pipx install poetry-add-requirements.txt

pip

$ pip install poetry-add-requirements.txt

Usage

Run poetry-add-requirements.txt, optionally specify your requirements.txt files and --dev for dev dependencies.

poeareq is provided is an alias to poetry-add-requirements.txt.

$ poeareq --help

usage: poetry-add-requirements.txt [-h] [-D] [-I] [-i] [-n] [-p ...] [-V]
                                   [requirements.txt file(s) ...]

Add dependencies specified in requirements.txt to your Poetry project

positional arguments:
  requirements.txt file(s)
                        Path(s) to your requirements.txt file(s) (default:
                        requirements.txt)

options:
  -h, --help            show this help message and exit
  -D, --dev             Add to development dependencies (default: False)
  -I, --ignore-version-requirements
                        Ignore dependency version requirements in
                        requirements.txt file(s) (default: False)
  -i, --ignore-errors   Ignore errors (default: False)
  -n, --dry-run         Dry run, do not add dependencies (default: False)
  -p ..., --poetry-args ...
                        Additional arguments to pass to Poetry, put this at
                        the END of the command (default: None)
  -V, --version         show program's version number and exit

Usage examples and tips

For examples, see test-extra-args.sh.

Tips:

  • Put all req files before any options
  • Put -p, --poetry-args at the end of the command
  • Pass -n, --dry-run to see the poetry commands that would be run

Develop

$ git clone https://github.com/tddschn/poetry-add-requirements.txt.git
$ cd poetry-add-requirements.txt
$ poetry install

poetry-add-requirements.txt's People

Contributors

tddschn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

poetry-add-requirements.txt's Issues

Comments in requirements.txt

poetry-add-requirements.txt v1.1.1

Comment (lines beginning with #) are treated as requirement entries, which results in failure. https://pip.pypa.io/en/stable/reference/requirements-file-format/

requirements.txt:
panel
#datashader
holoviews

log:
โ€ข panel

If you want to update it to the latest compatible version, you can use poetry update package.
If you prefer to upgrade it to the latest available version, you can use poetry add package@latest.

Nothing to add.
Running poetry add #datashader

'files'
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
...

support ignoring failures

it would be nice to be able to ingore failures. This is useful since not all package requirements could be satisfiable.

something like:

usage: poetry-add-requirements.txt [-h] [-D] [-I] [-V] [--ignore-errors] [requirements.txt files ...]

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.