Contributions are welcome!
For typos and minor corrections, please feel free to submit a PR. For technical changes, please speak with the core team first. We'd hate to turn down your awesome work.
Note: Due to a limitation in textual, Windows is not supported, but fear not, this works in WSL.
-
Fork the repository to get started.
-
Clone the repo and enter the
wtpython
folder.
git clone https://github.com/<your-name>/wtpython.git
cd wtpython
- Create and activate a virtual environment.
python -m venv .venv --prompt template
source .venv/bin/activate
- Upgrade pip and install Poetry. Please note that using an older version of Poetry or the old installer might not work as well.
python -m pip install --upgrade pip
# macOS / Linux / Bash
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
# Powershell
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python -
# Brew
brew install poetry
- Install the package in editable mode.
poetry install
If you add dependencies to the project, you'll have to run this command again to install the new dependencies. Make sure to pin the version in pyproject.toml
. This software is under a MIT license, so all dependencies must respect this. There is an automated test that will block contributions that violate MIT.
- Install pre-commit.
pre-commit install
The .pre-commit-config.yaml
file is configured to perform the following tasks on each commit:
- Validate yaml files
- Validate toml files
- Ensure a single new line on each file
- Ensure trailing white spaces are removed
- Ensure
noqa
annotations have specific codes - Ensure your Python imports are sorted consistently
- Check for errors with flake8
- Create a new branch in your repo. Using a branch other than main will help you when syncing a fork later.
git checkout -b <mybranch>
- Make some awesome changes!
We're excited to see what you can do. 🤩
- Commit your changes.
git add .
git commit -m "<description of changes>"
- Push your changes up to your repository.
git push --set-upstream origin <mybranch>
-
Open a Pull Request. Please provide a good description to help us understand what you've done. We are open to your suggestions and hope you'll be open to feedback if necessary.
-
Celebrate! You've just made an open-source contribution, 🎉 and you deserve a gold star! ⭐
If you didn't commit to your main branch then you can sync a fork with the web UI.
If you did commit to the main branch then you can merge the changes in.
If you want to replace your main branch with the upstream one do the following:
- Fetch upstream.
git fetch upstream
- Checkout the main branch.
git checkout main
- Reset your main branch using upstream.
git reset --hard upstream/main
- Force your main branch to your origin repo.
git push origin master --force