From d3c57fdc8423a61c2fbd8e0596de3f95a9851766 Mon Sep 17 00:00:00 2001 From: danilogalisteu Date: Mon, 23 Sep 2024 11:30:01 -0300 Subject: [PATCH 1/3] Added instructions for contributors (local development) --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/README.md b/README.md index e60aee0..74c386f 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ Future development efforts will focus on: The easiest way to install `bt` is from the [Python Package Index](https://pypi.python.org/pypi/bt/) using `pip`: + ```bash pip install bt ``` @@ -98,3 +99,52 @@ This environment allows you to plot your charts in-line and also allows you to easily add surrounding text with Markdown. You can easily create Notebooks that you can share with colleagues and you can also save them as PDFs. If you are not yet convinced, head over to their website. + +## Local development + +The following steps can be used to make an editable local copy of the repository in order to make changes and contribute to the `bt` framework. + +1. Fork the project repository by clicking on the 'Fork' button near the top right of the main repository page. This creates a copy of the code under your GitHub user account. + +2. Clone your fork of the `bt` repository from your GitHub account to your local disk: + +```bash +git clone git@github.com:/bt.git +cd bt +``` + +3. Create a new environment (e.g. `bt-dev`) using `venv` and activate it with the appropriate script for your system: + +```bash +python -m venv bt-dev +bt-dev\Scripts\activate.ps1 +``` + +4. Install the local copy of `bt` via `pip` in editable/development mode: + +```bash +pip install -e . +``` + +5. Create a feature branch (e.g. `my-feature`) to hold your development changes: + +```bash +git checkout -b my-feature +``` + +Always use a feature branch. It's good practice to never routinely work on the main branch of any repository. + +6. Make your changes, commit locally and add tests as required. Run the linter (`ruff`) and the tests (`pytest`) often: + +```bash +ruff check bt +pytest -vvv tests +``` + +7. Push the changes to your fork on GitHub: + +```bash +git push +``` + +8. Create a Pull Request on your forked repository page, selecting your feature branch (e.g. `my-feature`) as head and pointing to the original `pmorissette/bt` repository as base. From 078e39256e927c73fa8d3549d25d5b15c82d0306 Mon Sep 17 00:00:00 2001 From: danilogalisteu Date: Tue, 24 Sep 2024 10:05:44 -0300 Subject: [PATCH 2/3] Update README.md Simplified the change keeping the specific `make` information and linking to external references for inexperienced devs. --- README.md | 51 +++++++-------------------------------------------- 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 74c386f..7f92256 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,6 @@ Future development efforts will focus on: The easiest way to install `bt` is from the [Python Package Index](https://pypi.python.org/pypi/bt/) using `pip`: - ```bash pip install bt ``` @@ -100,51 +99,15 @@ easily add surrounding text with Markdown. You can easily create Notebooks that you can share with colleagues and you can also save them as PDFs. If you are not yet convinced, head over to their website. -## Local development - -The following steps can be used to make an editable local copy of the repository in order to make changes and contribute to the `bt` framework. - -1. Fork the project repository by clicking on the 'Fork' button near the top right of the main repository page. This creates a copy of the code under your GitHub user account. - -2. Clone your fork of the `bt` repository from your GitHub account to your local disk: - -```bash -git clone git@github.com:/bt.git -cd bt -``` - -3. Create a new environment (e.g. `bt-dev`) using `venv` and activate it with the appropriate script for your system: - -```bash -python -m venv bt-dev -bt-dev\Scripts\activate.ps1 -``` - -4. Install the local copy of `bt` via `pip` in editable/development mode: +## Contributing to bt -```bash -pip install -e . -``` - -5. Create a feature branch (e.g. `my-feature`) to hold your development changes: - -```bash -git checkout -b my-feature -``` +A Makefile is available to simplify local development. +[GNU Make](https://www.gnu.org/software/make/) is required to run the `make` targets directly, and it is not often preinstalled [on Windows systems](https://gnuwin32.sourceforge.net/packages/make.htm). -Always use a feature branch. It's good practice to never routinely work on the main branch of any repository. +When developing in Python, it's advisable to [create and activate a virtual environment](https://docs.python.org/3/library/venv.html) to keep the project's dependencies isolated from the system. -6. Make your changes, commit locally and add tests as required. Run the linter (`ruff`) and the tests (`pytest`) often: +After the usual preparation steps for [contributing to a GitHub project](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project) (forking, cloning, creating a feature branch), run `make develop` to install dependencies in the environment. -```bash -ruff check bt -pytest -vvv tests -``` - -7. Push the changes to your fork on GitHub: - -```bash -git push -``` +While making changes and adding tests, run `make lint` and `make test` often to check for mistakes. -8. Create a Pull Request on your forked repository page, selecting your feature branch (e.g. `my-feature`) as head and pointing to the original `pmorissette/bt` repository as base. +After commiting and pushing changes, create a Pull Request to discuss and get feedback on the proposed feature or fix. From 3652eecb85aca42ccbdf3e11f54a2f0764420527 Mon Sep 17 00:00:00 2001 From: danilogalisteu Date: Tue, 24 Sep 2024 10:19:52 -0300 Subject: [PATCH 3/3] Update README.md Added more links --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f92256..42afc9d 100644 --- a/README.md +++ b/README.md @@ -110,4 +110,4 @@ After the usual preparation steps for [contributing to a GitHub project](https:/ While making changes and adding tests, run `make lint` and `make test` often to check for mistakes. -After commiting and pushing changes, create a Pull Request to discuss and get feedback on the proposed feature or fix. +After [commiting and pushing changes](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project?tool=webui#making-and-pushing-changes), [create a Pull Request](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project?tool=webui#making-a-pull-request) to discuss and get feedback on the proposed feature or fix.