{"id":18676623,"url":"https://github.com/hitchdev/hitchkey","last_synced_at":"2025-04-12T02:13:12.810Z","repository":{"id":95872633,"uuid":"79485643","full_name":"hitchdev/hitchkey","owner":"hitchdev","description":"HitchKey bootstrapper - set up a development environment.","archived":false,"fork":false,"pushed_at":"2021-12-09T18:07:38.000Z","size":1479,"stargazers_count":7,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T02:13:06.588Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hitchdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-19T19:11:28.000Z","updated_at":"2024-07-31T11:24:27.000Z","dependencies_parsed_at":"2023-08-31T22:02:49.248Z","dependency_job_id":null,"html_url":"https://github.com/hitchdev/hitchkey","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitchdev%2Fhitchkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitchdev%2Fhitchkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitchdev%2Fhitchkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitchdev%2Fhitchkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hitchdev","download_url":"https://codeload.github.com/hitchdev/hitchkey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505925,"owners_count":21115354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T09:30:00.981Z","updated_at":"2025-04-12T02:13:12.802Z","avatar_url":"https://github.com/hitchdev.png","language":"Python","readme":"# HitchKey\n\nHitchKey is a multiplatform project python task runner.\n\nIt can tie together building code, running tests, generating docs,\nlinting and any other automated tasks under one command line interface\nenvironment running in docker, either in windows, mac or linux.\n\nIt runs ad hoc tasks from a file called key.py with an isolated,\nself-updating python 3 virtualenv. Installing packages for use\nby your tasks is as simple as adding their names in the\nrequirements file and running your task.\n\nIt is especially well suited to team projects as the project\ncan be used to build consistent development environments and\ndevelopment tasks that are more or less invariant no matter\nwhich machine\n\nhitch/key.py\n\n```python\nfrom commandlib import CommandError, Command, python, python_bin\nfrom hitchrun import DIR, expected\n\n# Usable path.py objects -- https://pathpy.readthedocs.io/en/stable/api.html\n\n# DIR.gen -- build directory (~/.hitch/xxxxxx, where the symlink 'gen' links to)\n# DIR.project -- the directory containng the \"hitch\" folder.\n# DIR.key -- the directory this file - key.py is in.\n# DIR.share -- ~/.hitch/share - build folder shared build artefacts.\n# DIR.cur -- the directory \"hk\" was run in.\n\n\n# If \"expected\" is used, no stacktrace will be displayed for that exception\n@expected(CommandError)\ndef hello(argument):\n    \"\"\"\n    Try running \"hk hello world\".\n    \"\"\"\n    # https://pathpy.readthedocs.io/en/stable/api.html\n    DIR.gen.joinpath(\"hello.txt\").write_text(argument)\n\n    # https://hitchdev.com/commandlib/\n    Command(\"cat\", \"hello.txt\").in_dir(DIR.gen).run()\n\n\n@expected(CommandError)\ndef runcommand():\n    \"\"\"\n    Run python 3 code with the hk virtualenv.\n    \"\"\"\n    python(\"pythoncode.py\").run()             # run python code using this project's virtualenv\n    python_bin.python(\"pythoncode.py\").run()  # equivalent\n```\n\nhitch/hitchreqs.in:\n\n```\nhitchrun\n# add python packages here and they will be installed automagically\n```\n\n\n\n```\n$ hk\n\nUsage: hk command [args]\n\n       hello - Try running \"hk hello world\".\n  runcommand - Run python 3 code with the hk virtualenv.\n\nRun 'hk help [command]' to get more help on a particular command.\n\n\n  hk --upgradepip - Upgrade hitch virtualenv's setuptools and pip\n     hk --upgrade - Upgrade all dependencies in hitchreqs.in\n  hk --cleanshare - Delete ~/.hitch/share/ folder.\n       hk --clean - Delete gen folder\n```\n\n## Getting started\n\nOn windows: \n```\nhk --demo key\n\nhk helloworld\n```\n\nThis will create a new directory called \"hitch\" and put five things in there:\n\n* ```key.py``` - the methods which you can run with \"hk command\".\n* ```gen``` - a symlink to the gen folder (e.g. ~/.hitch/ltnd0x) which contains the hitchkey's python 3 virtualenv and build folder.\n* ```hitchreqs.in``` - the python packages which you want installed in this virtualenv.\n* ```hitchreqs.txt``` - the compiled and frozen list of all the packages (does not need to be edited by hand).\n* ```__pycache__``` - folder containing the compiled version of key.py.\n\nIf you open hitch/key.py in a text editor and poke around and run 'hk' in that folder you can see what\nit is capable of.\n\n\n## Using hitchkey when you already have a key.py\n\nOnce installed, you can simply cd to any project directory with a key.py file or a hitch/key.py file\nand run 'hk' and it will set up the environment, installing all the packages specified in hitchreqs.txt.\n\n## Why hitchkey instead of make/pyinvoke/rake?\n\nThis project grew out of a bash script that I kept creating repeatedly called \"dev.sh\" that I used to\nkeep in the root of every project. I would use it to run various development environment workflow tasks\nlike rebuilding code, running tests or deploying.\n\nOver time I found myself building more and more complex workflows, and it became easier just to \nuse python and its ecosystem of packages.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitchdev%2Fhitchkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhitchdev%2Fhitchkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitchdev%2Fhitchkey/lists"}