Skip to content

Commit

Permalink
Port the existing export command to a plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater committed May 21, 2021
0 parents commit 33d2628
Show file tree
Hide file tree
Showing 39 changed files with 3,868 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[flake8]
max-line-length = 88
ignore = E501, E203, W503
per-file-ignores =
__init__.py:F401
exclude =
.git
__pycache__
setup.py
build
dist
releases
.venv
.tox
.mypy_cache
.pytest_cache
.vscode
.github
tests/fixtures/
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
*.pyc

# Packages
*.egg
!/tests/**/*.egg
/*.egg-info
/dist/*
build
_build
.cache
*.so

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
.pytest_cache

.DS_Store
.idea/*
.python-version
.vscode/*

/test.py
/test_*.*

/setup.cfg
MANIFEST.in
/setup.py
/docs/site/*
/tests/fixtures/simple_project/setup.py
.mypy_cache

.venv
/releases/*
pip-wheel-metadata
/poetry.toml
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
repos:
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8

- repo: https://github.com/timothycrosley/isort
rev: 5.7.0
hooks:
- id: isort
additional_dependencies: [toml]
exclude: ^.*/?setup\.py$

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
exclude: |
(?x)(
^tests/.*/fixtures/.*
)
- id: end-of-file-fixer
exclude: ^tests/.*/fixtures/.*
- id: debug-statements
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Poetry export plugin

This package is a plugin that allows the export of locked packages to various formats.

**Note**: For now, only the `requirements.txt` format is available.

This plugin provides the same features as the existing `export` command of POetry which it will eventually replace.


## Installation

The easiest way to install the `export` plugin is via the `plugin add` command of Poetry.

```bash
poetry plugin add poetry-export-plugin
```

If you used `pipx` to install Poetry you can add the plugin via the `pipx inject` command.

```bash
pipx inject poetry poetry-export-plugin
```

Otherwise, if you used `pip` to install Poetry you can add the plugin packages via the `pip install` command.

```bash
pip install poetry-export-plugin
```


## Usage

The plugin provides an `export` command to export to the desired format.

```bash
poetry export -f requirements.txt --output requirements.txt
```

**Note**: Only the `requirements.txt` format is currently supported.

### Available options

* `--format (-f)`: The format to export to (default: `requirements.txt`). Currently, only `requirements.txt` is supported.
* `--output (-o)`: The name of the output file. If omitted, print to standard output.
* `--dev`: Include development dependencies.
* `--extras (-E)`: Extra sets of dependencies to include.
* `--without-hashes`: Exclude hashes from the exported file.
* `--with-credentials`: Include credentials for extra indices.
Loading

0 comments on commit 33d2628

Please sign in to comment.