1Development And Publishing 2========================== 3 4Environment Setup 5----------------- 6 7To create a local virtualenv, run:: 8 9 make setup 10 11This will create a virtualenv at ``./venv``, install dependencies with pip, 12and install pyright using npm. 13 14To activate the environment in your shell:: 15 16 . ./venv/bin/activate 17 18Alternately, run everything with the make tasks, which source the activate 19script before running commands. 20 21conda 22~~~~~ 23 24To create a Conda environment, run:: 25 26 conda env create 27 npm i 28 29To update the environment, run:: 30 31 conda env update 32 npm i --update 33 34To activate the environment, run:: 35 36 conda activate pyee 37 38The other Makefile tasks should operate normally if the environment is 39activated. 40 41Formatting, Linting and Testing 42------------------------------- 43 44The basics are wrapped with a Makefile:: 45 46 make format # runs black 47 make lint # runs flake8 48 make test # runs pytest 49 50Generating Docs 51--------------- 52 53Docs for published projects are automatically generated by readthedocs, but 54you can also preview them locally by running:: 55 56 make build_docs 57 58Then, you can serve them with Python's dev server with:: 59 60 make serve_docs 61 62Publishing 63---------- 64 65Do a Final Check 66~~~~~~~~~~~~~~~~ 67 68Make sure that formatting looks good and that linting and testing are passing. 69 70Update the Changelog 71~~~~~~~~~~~~~~~~~~~~ 72 73Update the CHANGELOG.rst file to detail the changes being rolled into the new 74version. 75 76Update the Version in setup.py 77~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 78 79This project *used* to use ``vcversioner`` and versioning of the package 80would automatically leverage the appropriate git tag, but that is no longer the 81case. 82 83I do my best to follow `semver <https://semver.org>` when updating versions. 84 85Add a Git Tag 86~~~~~~~~~~~~~ 87 88This project uses git tags to tag versions:: 89 90 git tag -a {version} -m 'Release {version}' 91 92You don't need to prefix the version with a ``v``. 93 94Build and Publish 95~~~~~~~~~~~~~~~~~ 96 97To package everything, run:: 98 99 make package 100 101To publish:: 102 103 make publish 104 105Push the Tag to GitHub 106~~~~~~~~~~~~~~~~~~~~~~ 107 108:: 109 110 git push origin main --tags 111 112Check on RTD 113~~~~~~~~~~~~ 114 115RTD should build automatically but I find there's a delay so I like to kick it 116off manually. Log into `RTD <https://readthedocs.org>`, log in, then go 117to `the pyee project page <https://readthedocs.org/projects/pyee/>` and build 118latest and stable. 119 120Announce on Twitter 121~~~~~~~~~~~~~~~~~~~ 122 123It's not official, but I like to announce the release on Twitter. 124