Commit 3f5d4831 by Bjorn Neergaard

docs(contributing): rework contributing docs extensively

Co-authored-by: Mathieu Kniewallner <mathieu.kniewallner@gmail.com>
parent 16725163
...@@ -8,26 +8,25 @@ assignees: '' ...@@ -8,26 +8,25 @@ assignees: ''
--- ---
<!-- <!--
Hi there! Thank you for discovering and submitting an issue. Hi there! Thank you for submitting a bug report!
Before you submit this; let's make sure of a few things. Before you submit your issue, please review and follow the instructions at
Please make sure the following boxes are ticked if they are correct. https://python-poetry.org/docs/contributing/#reporting-bugs. Fully fill out the template below; insufficient
If not, please try and fulfill these first. information or bad reproduction instructions will impair the ability of others to help you.
--> -->
<!-- Checked checkbox should look like this: [x] --> <!-- All the below information must be provided for others to understand and help with your issue. -->
- [ ] I am on the [latest](https://github.com/python-poetry/poetry/releases/latest) Poetry version. - **Poetry version**: <!-- Replace with version, e.g. from `poetry --version` -->
- [ ] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate. - **Python version**: <!-- Replace with the version of Python being used to run Poetry, as reported by `poetry debug info` -->
- [ ] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option). - **OS version and name**: <!-- Replace with version + name, e.g. Ubuntu 22.04 or macOS 12.6 -->
- **pyproject.toml**: <!-- Replace with a link to a Gist (https://gist.github.com/) containing your sanitized pyproject.toml -->
<!-- <!-- All the below steps should be completed before submitting your issue. Checked checkbox should look like this: [x] -->
Once those are done, if you're able to fill in the following list with your information, - [ ] I am on the [latest](https://github.com/python-poetry/poetry/releases/latest) stable Poetry version, installed using a recommended method.
it'd be very helpful to whoever handles the issue. - [ ] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate.
--> - [ ] I have consulted the [FAQ](https://python-poetry.org/docs/faq/) and [blog](https://python-poetry.org/blog/) for any relevant entries or release notes.
- [ ] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option) and have included the output below.
- **OS version and name**: <!-- Replace with version + name -->
- **Poetry version**: <!-- Replace with version -->
- **Link of a [Gist](https://gist.github.com/) with the contents of your pyproject.toml file**: <!-- Gist Link Here -->
## Issue ## Issue
<!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤️ --> <!-- Now feel free to write your issue, and please be as descriptive as possible! Make sure to include detailed reproduction steps. -->
<!-- Thanks again 🙌 ❤ -->
--- ---
name: "\U0001F4DA Documentation" name: "\U0001F4DA Documentation Issue"
about: Did you find errors, problems, or anything unintelligible in the docs (https://python-poetry.org/docs)? about: Did you find errors, omissions, or anything unintelligible in the documentation?
title: '' title: ''
labels: area/docs, status/triage labels: area/docs, status/triage
assignees: '' assignees: ''
...@@ -8,15 +8,14 @@ assignees: '' ...@@ -8,15 +8,14 @@ assignees: ''
--- ---
<!-- <!--
Hi there! Thank you for discovering and submitting an issue with our documentation. Hi there! Thank you for helping improve our documentation!
Before you submit this; let's make sure of a few things. Before you submit your issue, please make sure you have completed the checklist below.
Please make sure the following boxes are ticked if they are correct.
If not, please try and fulfill these first.
--> -->
<!-- Checked checkbox should look like this: [x] --> <!-- All the below steps should be completed before submitting your issue. Checked checkbox should look like this: [x] -->
- [ ] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate. - [ ] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate.
## Issue ## Issue
<!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤️ --> <!-- Now feel free to write your issue, and please be as descriptive as possible! -->
<!-- Thanks again 🙌 ❤ -->
--- ---
name: "\U0001F381 Feature Request" name: "\U0001F381 Feature Request"
about: Do you have ideas for new features and improvements? about: Do you have ideas for new features or improvements?
title: '' title: ''
labels: kind/feature, status/triage labels: kind/feature, status/triage
assignees: '' assignees: ''
...@@ -8,16 +8,16 @@ assignees: '' ...@@ -8,16 +8,16 @@ assignees: ''
--- ---
<!-- <!--
Hi there! Thank you for wanting to make Poetry better. Hi there! Thank you for submitting a feature request!
Before you submit this; let's make sure of a few things. Before you submit your issue, please review and follow the instructions at
Please make sure the following boxes are ticked if they are correct. https://python-poetry.org/docs/contributing/#suggesting-enhancements.
If not, please try and fulfill these first.
--> -->
<!-- Checked checkbox should look like this: [x] --> <!-- All the below steps should be completed before submitting your issue. Checked checkbox should look like this: [x] -->
- [ ] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate. - [ ] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate.
- [ ] I have searched the [documentation](https://python-poetry.org/docs/) and believe that my question is not covered. - [ ] I have searched the [FAQ](https://python-poetry.org/docs/faq/) and general [documentation](https://python-poetry.org/docs/) and believe that my question is not already covered.
## Feature Request ## Feature Request
<!-- Now feel free to write your idea for improvement. Thanks again 🙌 ❤️ --> <!-- Now feel free to write your issue, and please be as descriptive as possible! -->
<!-- Thanks again 🙌 ❤ -->
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser # Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: true blank_issues_enabled: false
contact_links: contact_links:
- name: '💬 Discussions'
url: https://github.com/python-poetry/poetry/discussions
about: |
Ask questions about using Poetry, Poetry's features and roadmap, or get support and feedback for your usage of Poetry.
- name: '💬 Discord Server' - name: '💬 Discord Server'
url: https://discordapp.com/invite/awxPgve url: https://discordapp.com/invite/awxPgve
about: | about: |
Chat with the community, ask questions and learn about best practices. Chat with the community and Poetry maintainers about both the usage of and development of the project.
<!--
The content of this file is manually kept in sync with docs/contributing.md. There are formatting differences because this file uses plain markdown.
-->
# Contributing to Poetry
First off, thanks for taking the time to contribute!
The following is a set of guidelines for contributing to Poetry on GitHub. These are mostly guidelines, not rules. Use your best judgement, and feel free to propose changes to this document in a pull request.
#### Table of contents
[How to contribute](#how-to-contribute)
* [Reporting bugs](#reporting-bugs)
* [Suggesting enhancements](#suggesting-enhancements)
* [Contributing to documentation](#contributing-to-documentation)
* [Contributing to code](#contributing-to-code)
* [Issue triage](#issue-triage)
* [Git workflow](#git-workflow)
## How to contribute
### Reporting bugs
This section guides you through submitting a bug report for Poetry.
Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports.
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) to be sure that you need to create one. When you are creating a bug report, please include as many details as possible. Fill out the [required template](https://github.com/python-poetry/poetry/blob/master/.github/ISSUE_TEMPLATE/---bug-report.md), the information it asks helps the maintainers resolve the issue faster.
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
#### Before submitting a bug report
* **Check the [FAQs on the official website](https://python-poetry.org/docs/faq)** for a list of common questions and problems.
* **Check that your issue does not already exist in the [issue tracker](https://github.com/python-poetry/poetry/issues)**.
#### How do I submit a bug report?
Bugs are tracked on the [official issue tracker](https://github.com/python-poetry/poetry/issues) where you can create a new one and provide the following information by filling in [the template](https://github.com/python-poetry/poetry/blob/master/.github/ISSUE_TEMPLATE/---bug-report.md).
Explain the problem and include additional details to help maintainers reproduce the problem:
* **Use a clear and descriptive title** for the issue to identify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible.
* **Provide your pyproject.toml file** in a [Gist](https://gist.github.com) after removing potential private information (like private package repositories).
* **Provide specific examples to demonstrate the steps to reproduce the issue**. Include links to files or GitHub projects, or copy-paste-able snippets, which you use in those examples.
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
* **Explain which behavior you expected to see instead and why.**
* **If the problem is an unexpected error being raised**, execute the corresponding command in **debug** mode (the `-vvv` option).
Provide more context by answering these questions:
* **Did the problem start happening recently** (e.g. after updating to a new version of Poetry) or was this always a problem?
* If the problem started happening recently, **can you reproduce the problem in an older version of Poetry?** What's the most recent version in which the problem doesn't happen?
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
Include details about your configuration and environment:
* **Which version of Poetry are you using?** You can get the exact version by running `poetry -V` in your terminal.
* **Which Python version Poetry has been installed for?** Execute the `poetry debug info` to get the information.
* **What's the name and version of the OS you're using**?
### Suggesting enhancements
This section guides you through submitting an enhancement suggestion for Poetry, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions.
Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-an-enhancement-suggestion). Fill in [the template](https://github.com/python-poetry/poetry/blob/master/.github/ISSUE_TEMPLATE/---feature-request.md), including the steps that you imagine you would take if the feature you're requesting existed.
#### Before submitting an enhancement suggestion
* **Check the [FAQs on the official website](https://python-poetry.org/docs/faq)** for a list of common questions and problems.
* **Check that your issue does not already exist in the [issue tracker](https://github.com/python-poetry/poetry/issues)**.
#### How do I submit an Enhancement suggestion?
Enhancement suggestions are tracked on the [official issue tracker](https://github.com/python-poetry/poetry/issues) where you can create a new one and provide the following information:
* **Use a clear and descriptive title** for the issue to identify the suggestion.
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
* **Provide specific examples to demonstrate the steps**..
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
### Contributing to documentation
One of the simplest ways to get started contributing to a project is through improving documentation. Poetry is constantly evolving, this means that sometimes our documentation has gaps. You can help by
adding missing sections, editing the existing content so it is more accessible or creating new content (tutorials, FAQs, etc).
> **Note:** A great way to understand Poetry's design and how it all fits together, is to add FAQ entries for commonly
> asked questions. Poetry members usually mark issues with [candidate/faq](https://github.com/python-poetry/poetry/issues?q=is%3Aissue+label%3Acandidate%2Ffaq+) to indicate that the issue either contains a response
> that explains how something works or might benefit from an entry in the FAQ.
Issues pertaining to the documentation are usually marked with the [Documentation](https://github.com/python-poetry/poetry/labels/Documentation) label.
### Contributing to code
#### Picking an issue
> **Note:** If you are a first time contributor, and are looking for an issue to take on, you might want to look for [Good First Issue](https://github.com/python-poetry/poetry/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22)
> labelled issues. We do our best to label such issues, however we might fall behind at times. So, ask us.
If you would like to take on an issue, feel free to comment on the issue tagging `@python-poetry/triage`. We are more than happy to discuss solutions on the issue. If you would like help with navigating
the code base, join us on our [Discord Server](https://discordapp.com/invite/awxPgve).
#### Local development
You will need Poetry to start contributing on the Poetry codebase. Refer to the [documentation](https://python-poetry.org/docs/#introduction) to start using Poetry.
> **Note:** Local development of Poetry requires Python 3.8 or newer.
You will first need to clone the repository using `git` and place yourself in its directory:
```bash
git clone git@github.com:python-poetry/poetry.git
cd poetry
```
> **Note:** We recommend that you use a personal [fork](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/fork-a-repo) for this step. If you are new to GitHub collaboration,
> you can refer to the [Forking Projects Guide](https://guides.github.com/activities/forking/).
Now, you will need to install the required dependency for Poetry and be sure that the current
tests are passing on your machine:
```bash
poetry install
poetry run pytest tests/
```
Poetry uses [mypy](https://github.com/python/mypy) for typechecking, and the CI
will fail if it finds any errors. To run mypy locally:
```bash
poetry run mypy
```
Poetry uses the [black](https://github.com/psf/black) coding style and you must ensure that your
code follows it. If not, the CI will fail and your Pull Request will not be merged.
Similarly, the import statements are sorted with [isort](https://github.com/timothycrosley/isort)
and special care must be taken to respect it. If you don't, the CI will fail as well.
To make sure that you don't accidentally commit code that does not follow the coding style, you can
install a pre-commit hook that will check that everything is in order:
```bash
poetry run pre-commit install
```
You can also run it anytime using:
```bash
poetry run pre-commit run --all-files
```
Your code must always be accompanied by corresponding tests, if tests are not present your code
will not be merged.
#### Pull requests
* Fill in [the required template](https://github.com/python-poetry/poetry/blob/master/.github/PULL_REQUEST_TEMPLATE.md)
* Be sure that your pull request contains tests that cover the changed or added code.
* If your changes warrant a documentation change, the pull request must also update the documentation.
> **Note:** Make sure your branch is [rebased](https://docs.github.com/en/free-pro-team@latest/github/using-git/about-git-rebase) against the latest main branch. A maintainer might ask you to ensure the branch is
> up-to-date prior to merging your Pull Request if changes have conflicts.
All pull requests, unless otherwise instructed, need to be first accepted into the main branch (`master`).
### Issue triage
> **Note:** If you have an issue that hasn't had any attention, you can ping us `@python-poetry/triage` on the issue. Please, give us reasonable time to get to your issue first, spamming us with messages
> does not help anyone.
If you are helping with the triage of reported issues, this section provides some useful information to assist you in your contribution.
#### Triage steps
1. If `pyproject.toml` is missing or `-vvv` debug logs (with stack trace) is not provided and required, request that the issue author provides it.
1. Attempt to reproduce the issue with the reported Poetry version or request further clarification from the issue author.
1. Ensure the issue is not already resolved. You can attempt to reproduce using the latest preview release and/or poetry from the main branch.
1. If the issue cannot be reproduced,
1. clarify with the issue's author,
1. close the issue or notify `@python-poetry/triage`.
1. If the issue can be reproduced,
1. comment on the issue confirming so
1. notify `@python-poetry/triage`.
1. if possible, identify the root cause of the issue.
1. if interested, attempt to fix it via a pull request.
#### Multiple versions
Often times you would want to attempt to reproduce issues with multiple versions of `poetry` at the same time. For these use cases, the [pipx project](https://pypa.github.io/pipx/) is useful.
You can set your environment up like so.
```sh
pipx install --suffix @1.0.10 'poetry==1.0.10'
pipx install --suffix @1.1.0rc1 'poetry==1.1.0rc1'
pipx install --suffix @master 'poetry @ git+https://github.com/python-poetry/poetry'
```
> **Hint:** Do not forget to update your `poetry@master` installation in sync with upstream.
For `@local` it is recommended that you do something similar to the following as editable installs are not supported for PEP 517 projects.
```sh
# note this will not work for Windows, and we assume you have already run `poetry install`
cd /path/to/python-poetry/poetry
ln -sf $(poetry run which poetry) ~/.local/bin/poetry@local
```
> **Hint:** This mechanism can also be used to test pull requests.
### Git Workflow
All development work is performed against Poetry's main branch (`master`). All changes are expected to be submitted and accepted to this
branch.
#### Release branch
When a release is ready, the following are required before a release is tagged.
1. A release branch with the prefix `release-`, eg: `release-1.1.0rc1`.
1. A pull request from the release branch to the main branch (`master`) if it's a minor or major release. Otherwise, to the bug fix branch (eg: `1.0`).
1. The pull request description MUST include the change log corresponding to the release (eg: [#2971](https://github.com/python-poetry/poetry/pull/2971)).
1. The pull request must contain a commit that updates [CHANGELOG.md](CHANGELOG.md) and bumps the project version (eg: [#2971](https://github.com/python-poetry/poetry/pull/2971/commits/824e7b79defca435cf1d765bb633030b71b9a780)).
1. The pull request must have the `Release` label specified.
Once the branch pull-request is ready and approved, a member of `@python-poetry/core` will,
1. Tag the branch with the version identifier (eg: `1.1.0rc1`).
2. Merge the pull request once the release is created and assets are uploaded by the CI.
> **Note:** In this case, we prefer a merge commit instead of squash or rebase merge.
#### Bug fix branch
Once a minor version (eg: `1.1.0`) is released, a new branch for the minor version (eg: `1.1`) is created for the bug fix releases. Changes identified
or acknowledged by the Poetry team as requiring a bug fix can be submitted as a pull requests against this branch.
At the time of writing only issues meeting the following criteria may be accepted into a bug fix branch. Trivial fixes may be accepted on a
case-by-case basis.
1. The issue breaks a core functionality and/or is a critical regression.
1. The change set does not introduce a new feature or changes an existing functionality.
1. A new minor release is not expected within a reasonable time frame.
1. If the issue affects the next minor/major release, a corresponding fix has been accepted into the main branch.
> **Note:** This is subject to the interpretation of a maintainer within the context of the issue.
...@@ -56,7 +56,7 @@ build-backend = "poetry.core.masonry.api" ...@@ -56,7 +56,7 @@ build-backend = "poetry.core.masonry.api"
``` ```
Poetry assumes your package contains a package with the same name as `tool.poetry.name` located in the root of your Poetry assumes your package contains a package with the same name as `tool.poetry.name` located in the root of your
project. If this is not the case, populate [`tool.poetry.packages`]({{< relref "pyproject#packages" >}}) to specify project. If this is not the case, populate [`tool.poetry.packages`]({{< relref "pyproject#packages" >}}) to specify
your packages and their locations. your packages and their locations.
Similarly, the traditional `MANIFEST.in` file is replaced by the `tool.poetry.readme`, `tool.poetry.include`, and Similarly, the traditional `MANIFEST.in` file is replaced by the `tool.poetry.readme`, `tool.poetry.include`, and
...@@ -100,16 +100,16 @@ It will automatically find a suitable version constraint **and install** the pac ...@@ -100,16 +100,16 @@ It will automatically find a suitable version constraint **and install** the pac
Poetry supports a rich [dependency specification]({{< relref "dependency-specification" >}}) syntax, including caret, Poetry supports a rich [dependency specification]({{< relref "dependency-specification" >}}) syntax, including caret,
tilde, wildcard, inequality and tilde, wildcard, inequality and
[multiple constraint]({{< relref "dependency-specification#multiple-constraints-dependencies" >}}) requirements. [multiple constraints]({{< relref "dependency-specification#multiple-constraints-dependencies" >}}) requirements.
## Using your virtual environment ## Using your virtual environment
By default, poetry creates a virtual environment in `{cache-dir}/virtualenvs`. By default, Poetry creates a virtual environment in `{cache-dir}/virtualenvs`.
You can change the [`cache-dir`]({{< relref "configuration#cache-dir" >}} "cache-dir configuration documentation") value You can change the [`cache-dir`]({{< relref "configuration#cache-dir" >}} "cache-dir configuration documentation") value
by editing the Poetry config. by editing the Poetry configuration.
Additionally, you can use the Additionally, you can use the
[`virtualenvs.in-project`]({{< relref "configuration#virtualenvsin-project" >}}) configuration variable to create [`virtualenvs.in-project`]({{< relref "configuration#virtualenvsin-project" >}}) configuration variable to create
virtual environment within your project directory. virtual environments within your project directory.
There are several ways to run commands within this virtual environment. There are several ways to run commands within this virtual environment.
......
...@@ -7,275 +7,256 @@ layout: single ...@@ -7,275 +7,256 @@ layout: single
menu: menu:
docs: docs:
weight: 100 weight: 100
---
<!-- note: "Are you viewing this document on GitHub? For the best experience, view it on the website https://python-poetry.org/docs/contributing."
The content of this file is manually kept in sync with ../CONTRIBUTING.md. There are formatting differences because this file uses Hugo templating. ---
-->
# Contributing to Poetry # Contributing to Poetry
First off, thanks for taking the time to contribute! First off, thanks for taking the time to contribute!
The following is a set of guidelines for contributing to Poetry on GitHub. These are mostly guidelines, not rules. Use your best judgement, and feel free to propose changes to this document in a pull request. The following is a set of guidelines for contributing to Poetry on GitHub. These are mostly guidelines, not rules. Use
your best judgement, and feel free to propose changes to this document in a pull request.
#### Table of contents
[How to contribute](#how-to-contribute)
* [Reporting bugs](#reporting-bugs)
* [Suggesting enhancements](#suggesting-enhancements)
* [Contributing to documentation](#contributing-to-documentation)
* [Contributing to code](#contributing-to-code)
* [Issue triage](#issue-triage)
* [Git workflow](#git-workflow)
## How to contribute ## How to contribute
### Reporting bugs ### Reporting bugs
This section guides you through submitting a bug report for Poetry. This section guides you through submitting a bug report for Poetry.
Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find
related reports.
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) to be sure that you need to create one. When you are creating a bug report, please include as many details as possible. Fill out the [required template](https://github.com/python-poetry/poetry/blob/master/.github/ISSUE_TEMPLATE/---bug-report.md), the information it asks helps the maintainers resolve the issue faster.
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
#### Before submitting a bug report #### Before submitting a bug report
* **Check the [FAQs on the official website](https://python-poetry.org/docs/faq)** for a list of common questions and problems. * **Check the [FAQ]** for a list of common questions and problems.
* **Check that your issue does not already exist in the [issue tracker](https://github.com/python-poetry/poetry/issues)**. * **Check the [blog]** for release notes from recent releases, including steps for upgrading and known issues.
* **Check that your issue does not already exist** in the [issue tracker].
* **Make sure your issue is really a bug, and is not a support request or question** better suited for [Discussions]
or [Discord].
{{% note %}}
If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and
include a link to the original issue in the body of your new one.
{{% /note %}}
#### How do I submit a bug report? #### How do I submit a bug report?
Bugs are tracked on the [official issue tracker](https://github.com/python-poetry/poetry/issues) where you can create a new one and provide the following information by filling in [the template](https://github.com/python-poetry/poetry/blob/master/.github/ISSUE_TEMPLATE/---bug-report.md). Bugs concerning Poetry and poetry-core should be submitted to the main [issue tracker], using the correct
[issue template].
Explain the problem and include additional details to help maintainers reproduce the problem: Explain the problem and make it easy for others to search for and understand:
* **Use a clear and descriptive title** for the issue to identify the problem. * **Use a clear and descriptive title** for the issue to identify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible. * **Describe the exact steps which reproduce the problem** in as many details as possible.
* **Provide your pyproject.toml file** in a [Gist](https://gist.github.com) after removing potential private information (like private package repositories). * **Describe the behavior you observed after following the steps** and point out how this is a bug.
* **Provide specific examples to demonstrate the steps to reproduce the issue**. Include links to files or GitHub projects, or copy-paste-able snippets, which you use in those examples.
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
* **Explain which behavior you expected to see instead and why.** * **Explain which behavior you expected to see instead and why.**
* **If the problem is an unexpected error being raised**, execute the corresponding command in **debug** mode (the `-vvv` option). * **If the problem involves an unexpected error being raised**, execute the problematic command in **debug** mode
(with `-vvv` flag).
Provide detailed steps for reproduction of your issue:
* **Provide your pyproject.toml file** in a [Gist](https://gist.github.com), pastebin, or example repository after
removing potential private information like private package repositories or names.
* **Provide specific examples to demonstrate the steps to reproduce the issue**. This could be an example repository, a
sequence of steps run in a container, or just a pyproject.toml for very simple cases.
* **Are you unable to reliably reproduce the issue?** If so, provide details about how often the problem happens
and under which conditions it normally happens.
Provide more context by answering these questions: Provide more context by answering these questions:
* **Did the problem start happening recently** (e.g. after updating to a new version of Poetry) or was this always a problem? * **Did the problem start happening recently** (e.g. after updating to a new version of Poetry) or was this always a
* If the problem started happening recently, **can you reproduce the problem in an older version of Poetry?** What's the most recent version in which the problem doesn't happen? problem?
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens. * If the problem started happening recently, **can you reproduce the problem in an older version of Poetry?** What's the
most recent version in which the problem does not happen?
* **Is there anything exotic or unusual about your environment?** This could include use of special container images,
newer CPU architectures like Apple Silicon, or corporate proxies that intercept or modify your network traffic.
Include details about your configuration and environment: Include details about your configuration and environment:
* **Which version of Poetry are you using?** You can get the exact version by running `poetry -V` in your terminal. * **Which version of Poetry are you using?** You can get the exact version by running `poetry --version`.
* **Which Python version Poetry has been installed for?** Execute the `poetry debug info` to get the information. * **What version of Python is being used to run Poetry?** Execute the `poetry debug info` to get this information.
* **What's the name and version of the OS you're using**? * **What's the name and version of the OS you're using?** Examples include Ubuntu 22.04 or macOS 12.6.
To give others the best chance to understand and reproduce your issue, please be sure to put extra effort into your
reproduction steps. You can both rule out local configuration issues on your end, and ensure others can cleanly
reproduce your issue if attempt all reproductions in a pristine container (or VM), and provide the steps you performed
inside that container/VM in your issue report.
### Suggesting enhancements ### Suggesting enhancements
This section guides you through submitting an enhancement suggestion for Poetry, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions. This section guides you through submitting an enhancement suggestion for Poetry, including completely new features as
well as improvements to existing functionality. Following these guidelines helps maintainers and the community
Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-an-enhancement-suggestion). Fill in [the template](https://github.com/python-poetry/poetry/blob/master/.github/ISSUE_TEMPLATE/---feature-request.md), including the steps that you imagine you would take if the feature you're requesting existed. understand your suggestion and find related suggestions.
#### Before submitting an enhancement suggestion #### Before submitting a suggested enhancement
* **Check the [FAQs on the official website](https://python-poetry.org/docs/faq)** for a list of common questions and problems. * **Check the [FAQ]** for a list of common questions and problems.
* **Check that your issue does not already exist in the [issue tracker](https://github.com/python-poetry/poetry/issues)**. * **Check that your issue does not already exist** in the [issue tracker].
#### How do I submit an Enhancement suggestion? #### How do I submit a suggested enhancement?
Enhancement suggestions are tracked on the [official issue tracker](https://github.com/python-poetry/poetry/issues) where you can create a new one and provide the following information: Suggested enhancements concerning Poetry and poetry-core should be submitted to the main [issue tracker], using the
correct [issue template].
* **Use a clear and descriptive title** for the issue to identify the suggestion. * **Use a clear and descriptive title** for the issue to identify the suggestion.
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible. * **Provide a detailed description of the proposed enhancement**, with specific steps or examples when possible.
* **Provide specific examples to demonstrate the steps**.. * **Describe the current behavior** and **explain which behavior you would like to see instead**, and why.
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
### Contributing to documentation ### Documentation contributions
One of the simplest ways to get started contributing to a project is through improving documentation. Poetry is constantly evolving, this means that sometimes our documentation has gaps. You can help by One of the simplest ways to get started contributing to a project is through improving documentation. Poetry is
adding missing sections, editing the existing content so it is more accessible or creating new content (tutorials, FAQs, etc). constantly evolving, and this means that sometimes our documentation has gaps. You can help by adding missing sections,
editing the existing content to be more accessible, or creating new content such as tutorials, FAQs, etc.
{{% note %}} {{% note %}}
A great way to understand Poetry's design and how it all fits together, is to add FAQ entries for commonly Github [Discussions](https://github.com/python-poetry/poetry/discussions) and the
asked questions. Poetry members usually mark issues with [candidate/faq](https://github.com/python-poetry/poetry/issues?q=is%3Aissue+label%3Acandidate%2Ffaq+) to indicate that the issue either contains a response [kind/question label](https://github.com/python-poetry/poetry/labels/kind/question) are excellent sources for FAQ
that explains how something works or might benefit from an entry in the FAQ. candidates.
{{% /note %}} {{% /note %}}
Issues pertaining to the documentation are usually marked with the [Documentation](https://github.com/python-poetry/poetry/labels/Documentation) label. Issues pertaining to the documentation are usually marked with the [area/docs label], which will also trigger a preview
of the changes as rendered by this website.
### Contributing to code ### Code contributions
#### Picking an issue #### Picking an issue
{{% note %}} {{% note %}}
If you are a first time contributor, and are looking for an issue to take on, you might want to look for [Good First Issue](https://github.com/python-poetry/poetry/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22) If you are a first time contributor, and are looking for an issue to take on, you might want to look for
labelled issues. We do our best to label such issues, however we might fall behind at times. So, ask us. at the [contributing page](https://github.com/python-poetry/poetry/contribute) for candidates. We do our best to curate
good issues for first-time contributors there, but do fall behind -- so if you don't see anything good, feel free to
ask.
{{% /note %}} {{% /note %}}
If you would like to take on an issue, feel free to comment on the issue tagging `@python-poetry/triage`. We are more than happy to discuss solutions on the issue. If you would like help with navigating If you would like to take on an issue, feel free to comment on the issue tagging `@python-poetry/triage`.
the code base, join us on our [Discord Server](https://discordapp.com/invite/awxPgve). We are more than happy to discuss solutions on the issue. If you would like help with navigating the code base, are
looking for something to work on, or want feedback on a design or change, join us on our [Discord server][Discord] or
start a [Discussion][Discussions].
#### Local development #### Local development
You will need Poetry to start contributing on the Poetry codebase. Refer to the [documentation](https://python-poetry.org/docs/#introduction) to start using Poetry. Poetry is developed using Poetry. Refer to the [documentation] to install Poetry in your local environment.
{{% note %}} {{% note %}}
Local development of Poetry requires Python 3.8 or newer. Poetry's development toolchain requires Python 3.8 or newer.
{{% /note %}} {{% /note %}}
You will first need to clone the repository using `git` and place yourself in its directory: You should first fork the Poetry repository and then clone it locally, so that you can make pull requests against the
project. If you are new to Git and pull request based development, GitHub provides a
[guide](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) you will find helpful.
```bash Next, you should install Poetry's dependencies, and run the test suite to make sure everything is working as expected:
git clone git@github.com:python-poetry/poetry.git
cd poetry
```
{{% note %}}
We recommend that you use a personal [fork](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/fork-a-repo) for this step. If you are new to GitHub collaboration,
you can refer to the [Forking Projects Guide](https://guides.github.com/activities/forking/).
{{% /note %}}
Now, you will need to install the required dependency for Poetry and be sure that the current
tests are passing on your machine:
```bash ```bash
poetry install poetry install
poetry run pytest tests/ poetry run pytest
``` ```
Poetry uses [mypy](https://github.com/python/mypy) for typechecking, and the CI When you contribute to Poetry, automated tools will be run to make sure your code is suitable to be merged. Besides
will fail if it finds any errors. To run mypy locally: pytest, you will need to make sure your code typechecks properly using [mypy](http://mypy-lang.org/):
```bash ```bash
poetry run mypy poetry run mypy
``` ```
Poetry uses the [black](https://github.com/psf/black) coding style and you must ensure that your Finally, a great deal of linting tools are run on your code, to try and ensure consistent code style and root out common
code follows it. If not, the CI will fail and your Pull Request will not be merged. mistakes. The [pre-commit](https://pre-commit.com/) tool is used to install and run these tools, and requires one-time
setup:
Similarly, the import statements are sorted with [isort](https://github.com/timothycrosley/isort)
and special care must be taken to respect it. If you don't, the CI will fail as well.
To make sure that you don't accidentally commit code that does not follow the coding style, you can
install a pre-commit hook that will check that everything is in order:
```bash ```bash
poetry run pre-commit install poetry run pre-commit install
``` ```
You can also run it anytime using: pre-commit will now run and check your code every time you make a commit. By default, it will only run on changed files,
but you can run it on all files manually (this may be useful if you altered the pre-commit config):
```bash ```bash
poetry run pre-commit run --all-files poetry run pre-commit run --all-files
``` ```
Your code must always be accompanied by corresponding tests, if tests are not present your code
will not be merged.
#### Pull requests #### Pull requests
* Fill in [the required template](https://github.com/python-poetry/poetry/blob/master/.github/PULL_REQUEST_TEMPLATE.md) * Fill out the pull request body completely and describe your changes as accurately as possible. The pull request body
* Be sure that your pull request contains tests that cover the changed or added code. should be kept up to date as it will usually form the base for the final merge commit and the changelog entry.
* If your changes warrant a documentation change, the pull request must also update the documentation. * Be sure that your pull request contains tests that cover the changed or added code. Tests are generally required for
code be to be considered mergable, and code without passing tests will not be merged.
* Ensure your pull request passes the mypy and pre-commit checks. Remember that you can run these tools locally
instead of relying on remote CI.
* If your changes warrant a documentation change, the pull request must also update the documentation. Make sure to
review the documentation preview generated by CI for any rendering issues.
{{% note %}} {{% note %}}
Make sure your branch is [rebased](https://docs.github.com/en/free-pro-team@latest/github/using-git/about-git-rebase) against the latest main branch. A maintainer might ask you to ensure the branch is Make sure your branch is [rebased](https://docs.github.com/en/get-started/using-git/about-git-rebase) against the latest
up-to-date prior to merging your Pull Request if changes have conflicts. base branch. A maintainer might ask you to ensure the branch is up-to-date prior to merging your pull request
(especially if there have been CI changes on the base branch), and will also ask you to fix any conflicts.
{{% /note %}} {{% /note %}}
All pull requests, unless otherwise instructed, need to be first accepted into the main branch (`master`). All pull requests, unless otherwise instructed, need to be first accepted into the `master` branch. Maintainers will
generally decide if any backports to other branches are required, and carry them out as needed.
### Issue triage ### Issue triage
{{% note %}} {{% note %}}
If you have an issue that hasn't had any attention, you can ping us `@python-poetry/triage` on the issue. Please, give us reasonable time to get to your issue first, spamming us with messages If you have an issue that hasn't had any attention, you can ping us `@python-poetry/triage` on the issue. Please give us
reasonable time to get to your issue first, and avoid pinging any individuals directly, especially if they are not part
of the Poetry team.
{{% /note %}} {{% /note %}}
If you are helping with the triage of reported issues, this section provides some useful information to assist you in your contribution. If you are helping with the triage of reported issues, this section provides some useful information to assist you in
your contribution.
#### Triage steps #### Triage steps
1. If `pyproject.toml` is missing or `-vvv` debug logs (with stack trace) is not provided and required, request that the issue author provides it. 1. Determine what area and versions of Poetry the issue is related to, and set the appropriate labels (e.g.
1. Attempt to reproduce the issue with the reported Poetry version or request further clarification from the issue author. `version/x.x.x`, `area/docs`, `area/venv`), and remove the `status/triage` label.
1. Ensure the issue is not already resolved. You can attempt to reproduce using the latest preview release and/or poetry from the main branch. 2. If requested information (such as debug logs, pyproject.toml, etc.) is not provided and is relevant, request it from
1. If the issue cannot be reproduced, the author.
1. clarify with the issue's author, 1. Set the `status/waiting-on-response` label while waiting to hear back from the author.
1. close the issue or notify `@python-poetry/triage`. 3. Attempt to reproduce the issue with the reported Poetry version or request further clarification from the author.
1. If the issue can be reproduced, 4. Ensure the issue is not already resolved. Try reproducing it on the latest stable release, the latest prerelease (if
1. comment on the issue confirming so present), and the development branch.
1. notify `@python-poetry/triage`. 5. If the issue cannot be reproduced,
1. if possible, identify the root cause of the issue. 1. request more reproduction steps and clarification from the issue's author,
1. if interested, attempt to fix it via a pull request. 2. set the `status/needs-reproduction` label,
3. close the issue if there is no reproduction forthcoming.
6. If the issue can be reproduced,
1. comment on the issue confirming so,
2. set the `status/confirmed` label,
3. if possible, identify the root cause of the issue,
4. if interested, attempt to fix it via a pull request.
#### Multiple versions #### Multiple versions
Often times you would want to attempt to reproduce issues with multiple versions of `poetry` at the same time. For these use cases, the [pipx project](https://pypa.github.io/pipx/) is useful. When trying to reproduce issues, you often want to use multiple versions of Poetry at the same time.
[pipx](https://pypa.github.io/pipx/) makes this easy to do:
You can set your environment up like so.
```sh ```sh
pipx install --suffix @1.0.10 'poetry==1.0.10' pipx install --suffix @1.2.1 'poetry==1.2.1'
pipx install --suffix @1.1.0rc1 'poetry==1.1.0rc1' pipx install --suffix @1.3.0rc1 'poetry==1.3.0rc1'
pipx install --suffix @master 'poetry @ git+https://github.com/python-poetry/poetry' pipx install --suffix @master 'poetry @ git+https://github.com/python-poetry/poetry'
``` pipx install --suffix @local '/path/to/local/clone/of/poetry'
{{% note %}}
Do not forget to update your `poetry@master` installation in sync with upstream.
{{% /note %}}
For `@local` it is recommended that you do something similar to the following as editable installs are not supported for PEP 517 projects.
```sh # now you can use any of the chosen versions of Poetry with their configured suffix, e.g.
# note this will not work for Windows, and we assume you have already run `poetry install` poetry@master --version
cd /path/to/python-poetry/poetry
ln -sf $(poetry run which poetry) ~/.local/bin/poetry@local
``` ```
{{% note %}} {{% note %}}
This mechanism can also be used to test pull requests. Do not forget to `pipx upgrade poetry@master` before using it, to make sure you have the latest changes.
{{% /note %}} {{% /note %}}
### Git Workflow
All development work is performed against Poetry's main branch (`master`). All changes are expected to be submitted and accepted to this
branch.
#### Release branch
When a release is ready, the following are required before a release is tagged.
1. A release branch with the prefix `release-`, eg: `release-1.1.0rc1`.
1. A pull request from the release branch to the main branch (`master`) if it's a minor or major release. Otherwise, to the bug fix branch (eg: `1.0`).
1. The pull request description MUST include the change log corresponding to the release (eg: [#2971](https://github.com/python-poetry/poetry/pull/2971)).
1. The pull request must contain a commit that updates [CHANGELOG.md](CHANGELOG.md) and bumps the project version (eg: [#2971](https://github.com/python-poetry/poetry/pull/2971/commits/824e7b79defca435cf1d765bb633030b71b9a780)).
1. The pull request must have the `Release` label specified.
Once the branch pull-request is ready and approved, a member of `@python-poetry/core` will,
1. Tag the branch with the version identifier (eg: `1.1.0rc1`).
2. Merge the pull request once the release is created and assets are uploaded by the CI.
{{% note %}} {{% note %}}
In this case, we prefer a merge commit instead of squash or rebase merge. This mechanism can also be used to test pull requests by using GitHub's pull request remote refs:
```sh
pipx install --suffix @pr1234 git+https://github.com/python-poetry/poetry.git@refs/pull/1234/head
```
{{% /note %}} {{% /note %}}
#### Bug fix branch [Blog]: {{< ref "/blog" >}}
[Documentation]: {{< ref "/docs" >}}
Once a minor version (eg: `1.1.0`) is released, a new branch for the minor version (eg: `1.1`) is created for the bug fix releases. Changes identified [FAQ]: {{< relref "faq" >}}
or acknowledged by the Poetry team as requiring a bug fix can be submitted as a pull requests against this branch. [Issue Tracker]: https://github.com/python-poetry/poetry/issues
[area/docs label]: https://github.com/python-poetry/poetry/labels/area/docs
At the time of writing only issues meeting the following criteria may be accepted into a bug fix branch. Trivial fixes may be accepted on a [kind/question label]: https://github.com/python-poetry/poetry/labels/kind/question
case-by-case basis. [Issue Template]: https://github.com/python-poetry/poetry/issues/new/choose
[Discussions]: https://github.com/python-poetry/poetry/discussions
1. The issue breaks a core functionality and/or is a critical regression. [Discord]: https://discord.com/invite/awxPgve
1. The change set does not introduce a new feature or changes an existing functionality.
1. A new minor release is not expected within a reasonable time frame.
1. If the issue affects the next minor/major release, a corresponding fix has been accepted into the main branch.
{{% note %}}
This is subject to the interpretation of a maintainer within the context of the issue.
{{% /note %}}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment