forked from python-poetry/poetry
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port the existing export command to a plugin
- Loading branch information
0 parents
commit 33d2628
Showing
39 changed files
with
3,868 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.