From 45a84ad591a68de8538e8b817f5e904f124734aa Mon Sep 17 00:00:00 2001 From: Brewster Malevich Date: Thu, 5 Dec 2024 14:31:36 -0800 Subject: [PATCH] Update CONTRIBUTING docs and PR template The example for creating a virtual environment is updated to use venv, which is bundled with modern python. Removed using flake8 in the PR template because we no longer use flake8 and because ruff is run as part of CI. --- .github/PULL_REQUEST_TEMPLATE.md | 1 - .gitignore | 11 ++++++++++- CONTRIBUTING.rst | 16 +++++++++------- whatsnew.rst | 1 + 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8e42b1f..6465bf6 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ - [ ] closes #xxxx - [ ] tests added / passed - [ ] docs reflect changes - - [ ] passes ``flake8 impactlab_tools tests docs`` - [ ] whatsnew entry diff --git a/.gitignore b/.gitignore index 27bb3c5..7cb3b5e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ __pycache__/ # Distribution / packaging .Python -env/ build/ develop-eggs/ dist/ @@ -25,6 +24,16 @@ var/ *.egg *_deploy_key* +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + + # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index cad20f6..8195083 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -69,12 +69,14 @@ code. Setting up your development environment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Install your local copy into a virtualenv. Assuming you have virtualenvwrapper -installed, this is how you set up your fork for local development:: +Install your local copy into a virtual environment. For example, using venv, +this is how you set up your fork for local development:: - $ mkvirtualenv impactlab-tools $ cd impactlab-tools/ - $ python setup.py develop + $ python3 -m venv .venv + $ source .venv/bin/activate + $ python3 -m pip install -r requirements.txt + $ python3 -m pip install -e . Developing your feature ~~~~~~~~~~~~~~~~~~~~~~~ @@ -115,13 +117,13 @@ When making any changes to the impactlab-tools codebase, follow the following st tests you just wrote. Run tests frequently to make sure you are maintaining compatibility with the rest of the package:: - $ python setup.py test - $ flake8 impactlab-tools tests docs + $ python3 -m pytest + $ python3 -m ruff check . You can run only the tests you wrote using pytest's expression matching syntax, e.g.:: - $ pytest -k test_my_new_feature + $ python3 -m pytest -k test_my_new_feature 7. When you are passing all of your tests, run the full test suite. diff --git a/whatsnew.rst b/whatsnew.rst index 528c217..2219fcc 100644 --- a/whatsnew.rst +++ b/whatsnew.rst @@ -7,6 +7,7 @@ Unreleased ---------- - Minor code style update. + - Update CONTRIBUTING docs to use ``venv`` in the example for creating virtual environments. This tool is bundled with Python by default. v0.6.0 (May 31, 2024) ---------------------