Package: hdev
hdevThe CLI for the Hypothesis development environment.Installation & UpgradingThe instructions below usepipxto
installhdev.pipxwill installhdevin its own isolated virtualenv at~/.local/pipx/venvs/hdevand add it to yourPATH, withoutsudo. You can
easily uninstall it again withpipx uninstall hdev. It won't touch your
system Python environment at all.Installing on macOSInstallHomebrewand then run:brew install pipx
pipx ensurepath
pipx install hdevInstalling on Linuxpython3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install hdevUpgrading (on either macOS or Linux)To upgrade hdev to the latest version:pipx upgrade hdevUsageusage: hdev [-h] [--project PROJECT_DIR] [--find FIND_COMMAND] [--debug] {alembic,clean,config,deps,install-python,python_version,requirements,run,template} ...

positional arguments:
  {alembic,clean,config,deps,install-python,python_version,requirements,run,template}
    alembic             Run alembic commands to create and execute DB migrations.
    clean               Clean a project directory
    config              Get format and run data from pyproject.toml
    deps                Get dependency information
    install-python      Install the versions of python listed in the `.python-version` file.
    python_version      Dump the versions of Python in various formats
    requirements        Compiles .txt requirements file based on the existing .in files using pip-tools
    run                 Run a custom command defined in the pyproject.toml file
    template            Update the local project template

optional arguments:
  -h, --help            show this help message and exit
  --project PROJECT_DIR
                        Path of the project's root. Defaults to '.'. Can be specified multiple times
  --find FIND_COMMAND   Find projects from the current directory. This can be one of 'APPS', 'LIBS', 'ANY' or a comma separated list of project names.
  --debug               Enable debugging infoConfigurationhdevis configured within your project'spyproject.tomlfile with the following options:[tool.hdev]project_name="myproject"project_type="library"# Or "application"[tool.hdev.clean]# File and directory patterns relative to the root to remove.# These support shell expansions and patternsfiles=["dir/sub_dir/my_specific_file.txt"]dirs=["resources/__myapp_cache__"]# File and directory names which will be removed anywhere they# are found. These support shell expansions and patternsfile_names=["*.ini"]dir_names=["_cache_*"]# Control if empty dirs are cleaned or notempty_dirs=false[tool.hdev.run]# Add a custom command runnable with `hdev run custom`mycommand.command="echo hello"mycommand.help="Say hello!"You can choose to not use any configuration, in that casehdevprovides
sensible default for most Hypothesis projects.HackingInstalling hdev in a development environmentYou will needGitpyenvFollow the instructions in the pyenv README to install itOn macOS: the Homebrew method works best on macOSOn Ubuntu: follow the Basic GitHub Checkout methodGraphviz[optional]This is only needed for thehdev deps --graphcommandOn macOS:brew install graphvizOn Ubuntu:sudo apt install graphvizClone the git repogit clone https://github.com/hypothesis/hdev.gitThis will download the code into ahdevdirectory
in your current working directory. You need to be in thehdevdirectory for the rest of the installation
process:cd hdevRun the testsmake testThat's it!You’ve finished setting up your hdev
development environment. Runmake helpto see all the commands that're
available for linting, code formatting, packaging, etc.Updating the Cookiecutter scaffoldingThis project was created from thehttps://github.com/hypothesis/h-cookiecutter-pypackage/template.
If h-cookiecutter-pypackage itself has changed since this project was created, and
you want to update this project with the latest changes, you can "replay" the
cookiecutter over this project. Run:make templateThis will change the files in your working tree, applying the latest
updates from the h-cookiecutter-pypackage template. Inspect and test the
changes, do any fixups that are needed, and then commit them to git and send a
pull request.If you wantmake templateto skip certain files, never changing them, add
these files to"options.disable_replay"in.cookiecutter.jsonand commit that to git.If you wantmake templateto update a file that's listed indisable_replaysimply delete that file and then runmake template, it'll recreate the file
for you.