Skip to content

Commit

Permalink
Update CONTRIBUTING docs and PR template
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brews committed Dec 5, 2024
1 parent 9e102e2 commit 45a84ad
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] docs reflect changes
- [ ] passes ``flake8 impactlab_tools tests docs``
- [ ] whatsnew entry
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ __pycache__/

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
Expand All @@ -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.
Expand Down
16 changes: 9 additions & 7 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions whatsnew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
---------------------
Expand Down

0 comments on commit 45a84ad

Please sign in to comment.