Skip to content

Latest commit

 

History

History
118 lines (80 loc) · 3.51 KB

CONTRIBUTING.md

File metadata and controls

118 lines (80 loc) · 3.51 KB

Contributing

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.

  1. Fork the repository to get started.

  2. Clone the repo and enter the wtpython folder.

git clone https://github.com/<your-name>/wtpython.git
cd wtpython
  1. Create and activate a virtual environment.
python -m venv .venv --prompt template
source .venv/bin/activate
  1. 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
  1. 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.

  1. 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
  1. 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>
  1. Make some awesome changes!

We're excited to see what you can do. 🤩

  1. Commit your changes.
git add .
git commit -m "<description of changes>"
  1. Push your changes up to your repository.
git push --set-upstream origin <mybranch>
  1. 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.

  2. Celebrate! You've just made an open-source contribution, 🎉 and you deserve a gold star! ⭐

Syncing a fork

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:

  1. Fetch upstream.
git fetch upstream
  1. Checkout the main branch.
git checkout main
  1. Reset your main branch using upstream.
git reset --hard upstream/main
  1. Force your main branch to your origin repo.
git push origin master --force