mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-08-28 20:11:19 +08:00
poetry-{new,publish,remove,run,update}: add pages (#19639)
Co-authored-by: Dylan <145150333+dmmqz@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
25bc85727a
commit
76026d3bb8
@@ -0,0 +1,28 @@
|
||||
# poetry new
|
||||
|
||||
> Create a new Poetry project in a specific directory.
|
||||
> More information: <https://python-poetry.org/docs/cli/#new>.
|
||||
|
||||
- Create a new project (defaults to `src` layout):
|
||||
|
||||
`poetry new {{path/to/directory}}`
|
||||
|
||||
- Create a new project asking for configuration details interactively:
|
||||
|
||||
`poetry new {{path/to/directory}} {{[-i|--interactive]}}`
|
||||
|
||||
- Create a new project with a specific package name:
|
||||
|
||||
`poetry new {{path/to/directory}} --name {{package_name}}`
|
||||
|
||||
- Create a new project using the flat layout (without the `src` directory):
|
||||
|
||||
`poetry new {{path/to/directory}} --flat`
|
||||
|
||||
- Create a new project with a specific author:
|
||||
|
||||
`poetry new {{path/to/directory}} --author "{{Name <email@example.com>}}"`
|
||||
|
||||
- Create a new project with a specific README format:
|
||||
|
||||
`poetry new {{path/to/directory}} --readme {{md|rst|txt|...}}`
|
||||
@@ -0,0 +1,28 @@
|
||||
# poetry publish
|
||||
|
||||
> Publishes a package to a remote repository.
|
||||
> More information: <https://python-poetry.org/docs/cli/#publish>.
|
||||
|
||||
- Publish the current package to PyPI:
|
||||
|
||||
`poetry publish`
|
||||
|
||||
- Build the package before publishing:
|
||||
|
||||
`poetry publish --build`
|
||||
|
||||
- Publish to a specific repository:
|
||||
|
||||
`poetry publish {{[-r|--repository]}} {{repository_name}}`
|
||||
|
||||
- Publish with specific credentials:
|
||||
|
||||
`poetry publish {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}}`
|
||||
|
||||
- Perform a dry run to see what would be done without actually publishing:
|
||||
|
||||
`poetry publish --dry-run`
|
||||
|
||||
- Skip files that already exist in the repository:
|
||||
|
||||
`poetry publish --skip-existing`
|
||||
@@ -0,0 +1,24 @@
|
||||
# poetry remove
|
||||
|
||||
> Remove a package from the project dependencies.
|
||||
> More information: <https://python-poetry.org/docs/cli/#remove>.
|
||||
|
||||
- Remove one or more packages from the project's dependencies:
|
||||
|
||||
`poetry remove {{package1 package2 ...}}`
|
||||
|
||||
- Remove a package from the development dependencies:
|
||||
|
||||
`poetry remove {{package}} {{[-D|--dev]}}`
|
||||
|
||||
- Remove a package from a specific dependency group:
|
||||
|
||||
`poetry remove {{package}} {{[-G|--group]}} {{group_name}}`
|
||||
|
||||
- Remove a package without making any changes (dry-run):
|
||||
|
||||
`poetry remove {{package}} --dry-run`
|
||||
|
||||
- Update the lock file only, without removing the package from the environment:
|
||||
|
||||
`poetry remove {{package}} --lock`
|
||||
@@ -0,0 +1,20 @@
|
||||
# poetry run
|
||||
|
||||
> Run a command in the project's virtual environment.
|
||||
> More information: <https://python-poetry.org/docs/cli/#run>.
|
||||
|
||||
- Run a command inside the virtual environment:
|
||||
|
||||
`poetry run {{command}}`
|
||||
|
||||
- Run a command with arguments:
|
||||
|
||||
`poetry run {{command}} {{argument1 argument2 ...}}`
|
||||
|
||||
- Run a script defined in `pyproject.toml`:
|
||||
|
||||
`poetry run {{script_name}}`
|
||||
|
||||
- Run a Python script:
|
||||
|
||||
`poetry run python {{path/to/script.py}}`
|
||||
@@ -0,0 +1,28 @@
|
||||
# poetry update
|
||||
|
||||
> Update the dependencies as according to the `pyproject.toml` file.
|
||||
> More information: <https://python-poetry.org/docs/cli/#update>.
|
||||
|
||||
- Update all dependencies:
|
||||
|
||||
`poetry update`
|
||||
|
||||
- Update one or more specific packages:
|
||||
|
||||
`poetry update {{package1 package2 ...}}`
|
||||
|
||||
- Update the lock file only, without installing the packages:
|
||||
|
||||
`poetry update --lock`
|
||||
|
||||
- Synchronize the environment with the locked packages:
|
||||
|
||||
`poetry update --sync`
|
||||
|
||||
- Update dependencies only for a specific group:
|
||||
|
||||
`poetry update --only {{group_name}}`
|
||||
|
||||
- Simulate the update process without making changes:
|
||||
|
||||
`poetry update --dry-run`
|
||||
Reference in New Issue
Block a user