|
| 1 | +# Setting up Your pip-sync-faster Development Environment |
| 2 | + |
| 3 | +First you'll need to install: |
| 4 | + |
| 5 | +* [Git](https://git-scm.com/). |
| 6 | + On Ubuntu: `sudo apt install git`, on macOS: `brew install git`. |
| 7 | +* [GNU Make](https://www.gnu.org/software/make/). |
| 8 | + This is probably already installed, run `make --version` to check. |
| 9 | +* [pyenv](https://github.com/pyenv/pyenv). |
| 10 | + Follow the instructions in pyenv's README to install it. |
| 11 | + The **Homebrew** method works best on macOS. |
| 12 | + The **Basic GitHub Checkout** method works best on Ubuntu. |
| 13 | + You _don't_ need to set up pyenv's shell integration ("shims"), you can |
| 14 | + [use pyenv without shims](https://github.com/pyenv/pyenv#using-pyenv-without-shims). |
| 15 | + |
| 16 | +Then to set up your development environment: |
| 17 | + |
| 18 | +```terminal |
| 19 | +git clone https://github.com/hypothesis/pip-sync-faster.git |
| 20 | +cd pip_sync_faster |
| 21 | +make help |
| 22 | +``` |
| 23 | + |
| 24 | +Releasing a New Version of the Project |
| 25 | +-------------------------------------- |
| 26 | + |
| 27 | +1. First, to get PyPI publishing working you need to go to: |
| 28 | + <https://github.com/organizations/hypothesis/settings/secrets/actions/PYPI_TOKEN> |
| 29 | + and add pip-sync-faster to the `PYPI_TOKEN` secret's selected |
| 30 | + repositories. |
| 31 | + |
| 32 | +2. Now that the pip-sync-faster project has access to the `PYPI_TOKEN` secret |
| 33 | + you can release a new version by just [creating a new GitHub release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository). |
| 34 | + Publishing a new GitHub release will automatically trigger |
| 35 | + [a GitHub Actions workflow](.github/workflows/pypi.yml) |
| 36 | + that will build the new version of your Python package and upload it to |
| 37 | + <https://pypi.org/project/pip-sync-faster>. |
| 38 | + |
| 39 | +Changing the Project's Python Versions |
| 40 | +-------------------------------------- |
| 41 | + |
| 42 | +To change what versions of Python the project uses: |
| 43 | + |
| 44 | +1. Change the Python versions in the |
| 45 | + [cookiecutter.json](.cookiecutter/cookiecutter.json) file. For example: |
| 46 | + |
| 47 | + ```json |
| 48 | + "python_versions": "3.10.4, 3.9.12", |
| 49 | + ``` |
| 50 | + |
| 51 | +2. Re-run the cookiecutter template: |
| 52 | + |
| 53 | + ```terminal |
| 54 | + make template |
| 55 | + ``` |
| 56 | + |
| 57 | +3. Commit everything to git and send a pull request |
| 58 | + |
| 59 | +Changing the Project's Python Dependencies |
| 60 | +------------------------------------------ |
| 61 | + |
| 62 | +To change the production dependencies in the `setup.cfg` file: |
| 63 | + |
| 64 | +1. Change the dependencies in the [`.cookiecutter/includes/setuptools/install_requires`](.cookiecutter/includes/setuptools/install_requires) file. |
| 65 | + If this file doesn't exist yet create it and add some dependencies to it. |
| 66 | + For example: |
| 67 | + |
| 68 | + ``` |
| 69 | + pyramid |
| 70 | + sqlalchemy |
| 71 | + celery |
| 72 | + ``` |
| 73 | + |
| 74 | +2. Re-run the cookiecutter template: |
| 75 | + |
| 76 | + ```terminal |
| 77 | + make template |
| 78 | + ``` |
| 79 | + |
| 80 | +3. Commit everything to git and send a pull request |
| 81 | + |
| 82 | +To change the project's formatting, linting and test dependencies: |
| 83 | + |
| 84 | +1. Change the dependencies in the [`.cookiecutter/includes/tox/deps`](.cookiecutter/includes/tox/deps) file. |
| 85 | + If this file doesn't exist yet create it and add some dependencies to it. |
| 86 | + Use tox's [factor-conditional settings](https://tox.wiki/en/latest/config.html#factors-and-factor-conditional-settings) |
| 87 | + to limit which environment(s) each dependency is used in. |
| 88 | + For example: |
| 89 | + |
| 90 | + ``` |
| 91 | + lint: flake8, |
| 92 | + format: autopep8, |
| 93 | + lint,tests: pytest-faker, |
| 94 | + ``` |
| 95 | + |
| 96 | +2. Re-run the cookiecutter template: |
| 97 | + |
| 98 | + ```terminal |
| 99 | + make template |
| 100 | + ``` |
| 101 | + |
| 102 | +3. Commit everything to git and send a pull request |
0 commit comments