Package: easypipinstall
EASY PIP INSTALLeasypipinstallis a dev utility that helps installing Python packages similarly to NPM in NodeJS. It automatically maintains therequirements.txt,prod-requirements.txtandsetup.cfgfiles. It also easily uninstalls all the dependencies from those files. It uses an opinionated pattern where:Only two types of dependencies exist:dev(via requirements.txt) andprod(via prod-requirements.txt, which is a subset of requirements.txt).All dependencies are listed underrequirements.txt.By default, dependencies are listed in bothrequirements.txtandprod-requirements.txt.Dependencies are not listed underprod-requirements.txtwhen the-Doption (development mode) is used.Thesetup.cfgfile is updated as follows:By default, the dependency is listed without its version under theinstall_requiresproperty of the[options]section.When the-Doption is used, the dependency is listed without its version under thedevproperty of the[options.extras_require]section.To install:pip install easypipinstallThis will add three new CLI utilities:easyi(install)easyu(uninstall)easyv(version)Examples:easyinumpyThis installsnumpy(viapip install) then automatically updates the following files:setup.cfg(WARNING: this file must already exists):[options]
 install_requires = 
 	numpyrequirements.txtandprod-requirements.txteasyiflake8black-DThis installsflake8andblack(viapip install) and then automatically updates the following files:setup.cfg(WARNING: this file must already exist):[options.extras_require]
 dev = 
 	black
 	flake8requirements.txtonly, as those dependencies are installed for development purposes only.easyuflake8This uninstallsflake8as well as all its dependencies. Those dependencies are uninstalled only if other project dependencies do not use them. Thesetup.cfgandrequirements.txtare automatically updated.Table of contentsAPIseasyito installeasyuto uninstalleasyvto versionDevGetting startedCLI commandsLinting, formatting and testingIgnoringflake8errorsSkipping testsExecuting a specific test onlyBuilding and distributing this packageFAQReferencesLicenseAPIseasyito installeasyinumpyThis installsnumpy(viapip install) then automatically updates the following files:setup.cfg(WARNING: this file must already exists):[options]
 install_requires = 
 	numpyrequirements.txtandprod-requirements.txteasyiflake8black-DThis installsflake8andblack(viapip install) and then automatically updates the following files:setup.cfg(WARNING: this file must already exist):[options.extras_require]
 dev = 
 	black
 	flake8requirements.txtonly, as those dependencies are installed for development purposes only.easyuto uninstalleasyuflake8This uninstallsflake8as well as all its dependencies. Those dependencies are uninstalled only if other project dependencies do not use them. Thesetup.cfgandrequirements.txtare automatically updated.easyvto versioneasyvThis returns the current package's version as defined in thesetup.cfgfile.easyvbumpBumps the patch bit of the version (e.g., before2.0.0after2.0.1). Up to three updates are applied:Updates the version property in thesetup.cfgfile.If the project is under source control with git and git is installed:Updates theCHANGELOG.mdfile using the commit messages between the current branch and the last version tag. If theCHANGELOG.mdfile does not exist, it is automatically created.git commit and tag (using the version number prefixed withv) the project.easyvbumppatchSame as above.easyvbumpminorUpdate the minor bit of the version.easyvbumpmajorUpdate the major bit of the version.easyvbump2.0.0Explicitly sets the version to2.0.0.DevDev - Getting startedClone this project:gitclonehttps://github.com/nicolasdao/easypipinstall.gitBrowse to the root folder:cdeasypipinstallCreate a new virtual environment:python3-mvenv.venvActivate this virtual environment:source.venv/bin/activateTo deactivate that virtual environment:deactivateCLI commandsmakecommands:CommandDescriptionpython3 -m venv .venvCreate a new virtual environment.source .venv/bin/activateActivate the virtual environmentdeactivateDeactivate the virtual environmentmake bBuilds the package.make pPublish the package tohttps://pypi.org.make bpBuilds the package and then publish it tohttps://pypi.org.make biBuilds the package and install it locally (pip install -e .).make installInstall the dependencies defined in therequirements.txt. This file contains all the dependencies (i.e., both prod and dev).make install-prodInstall the dependencies defined in theprod-requirements.txt. This file only contains the production dependencies.make nStarts a Jupyter notebook for this project.make tFormats, lints and then unit tests the project.make t testpath=<FULLY QUALIFIED TEST PATH>Foccuses the unit test on a specific test. For a concrete example, please refer to theExecuting a specific test onlysection.Linting, formatting and testingmake tThis command runs the following three python executables:black./
flake8./
pytest--capture=no--verbose$(testpath)blackformats all the.pyfiles, whileflake8lints them.blackis configured in thepyproject.tomlfile under the[tool.black]section.flake8is configured in thesetup.cfgfile under the[flake8]section.pytestruns all the.pyfiles located under thetestsfolder. The meaning of each option is as follow:--capture=noallows theprintfunction to send outputs to the terminal.--verbosedisplays each test. Without it, the terminal would only display the count of how many passed and failed.$(testpath)references thetestpathvariable. This variable is set totests(i.e., thetestsfolder) by default. This allows to override this default variable with something else (e.g., a specific test to only run that one).Ignoringflake8errorsThis project is pre-configured to ignore certainflake8errors. To add or removeflake8errors, update theextend-ignoreproperty under the[flake8]section in thesetup.cfgfile.Skipping testsIn your test file, add the@pytest.mark.skip()decorator. For example:importpytest@pytest.mark.skip()deftest_self_describing_another_test_name():# ... your test hereExecuting a specific test onlyOne of the output of themake tcommand is list of all the test that were run (PASSED and FAILED). For example:tests/error/test_catch_errors.py::test_catch_errors_basic PASSED
tests/error/test_catch_errors.py::test_catch_errors_wrapped PASSED
tests/error/test_catch_errors.py::test_catch_errors_nested_errors PASSED
tests/error/test_catch_errors.py::test_catch_errors_StackedException_arbitrary_inputs FAILEDTo execute a specific test only, add thetestpathoption with the test path. For example, to execute the only FAILED test in the example above, run this command:makettestpath=tests/error/test_catch_errors.py::test_catch_errors_StackedException_arbitrary_inputsBuilding and distributing this packageMake sure the test and lint operations have not produced errors:maketBuild this package:makebThis command is a wrapper aroundpython3 -m build.Version and tag this package using one of the following command (1):make v cmd=bump: Use this to bump the patch version.make v cmd=bump ver=minor: Use this to bump the minor version.make v cmd=bump ver=major: Use this to bump the major version.make v cmd=bump ver=x.x.x: Use this to bump the version to a specific value.
4 . Publish this package tohttps://pypi.org:makepThis command is a wrapper around the following commands:python3 -m build; twine upload dist/*To test your package locally before deploying it tohttps://pypi.org, you can run build and install it locally with this command:makebiThis command buils the package and follows withpip install -e ..(1): This step applies three updates:Updates the version property in thesetup.cfgfile.Updates theCHANGELOG.mdfile using the commit messages between the current branch and the last version tag.git commit and tag (using the version number prefixed withv) the project.FAQReferencesLicenseBSD 3-Clause LicenseCopyright (c) 2019-2023, Cloudless Consulting Pty Ltd
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.