{"id":25765531,"url":"https://github.com/jidn/python-makefile","last_synced_at":"2025-07-01T09:05:38.201Z","repository":{"id":90605371,"uuid":"49096151","full_name":"jidn/python-Makefile","owner":"jidn","description":"A python project Makefile with virtualenv, Travis CI, and PyPi integration.","archived":false,"fork":false,"pushed_at":"2018-01-02T16:31:52.000Z","size":46,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-01T09:05:25.602Z","etag":null,"topics":["makefile","project","python"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jidn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2016-01-05T22:17:24.000Z","updated_at":"2024-04-27T13:11:24.000Z","dependencies_parsed_at":"2023-03-02T17:15:23.077Z","dependency_job_id":null,"html_url":"https://github.com/jidn/python-Makefile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jidn/python-Makefile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jidn%2Fpython-Makefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jidn%2Fpython-Makefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jidn%2Fpython-Makefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jidn%2Fpython-Makefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jidn","download_url":"https://codeload.github.com/jidn/python-Makefile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jidn%2Fpython-Makefile/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262933261,"owners_count":23386778,"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":["makefile","project","python"],"created_at":"2025-02-26T22:19:41.344Z","updated_at":"2025-07-01T09:05:38.173Z","avatar_url":"https://github.com/jidn.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"In the attempt to create and use a standard Makefile for my python projects, this is the fruit of my labor.  It includes support for virtual environments, requirements, syntax checking, running tests, coverage and uploading packages to PyPI.  Why a Makefile instead of something modern?  Well because `make` is on every system I use and it does the job.\n\nTravis CI is also supported, see the  `travis.yml`, but remember to change the name of the file as required to `.travis.yml` (adding a leading dot) for proper Travis CI working.\n\nCopy this file\n\n```\ncurl https://raw.githubusercontent.com/jidn/python-Makefile/master/Makefile \u003e Makefile\n```\n\nand make the following changes:\n\n * _PACKAGE_ := myproject/  or empty if python files are in the same directory.\n * _PROJECT_ := MyProject\n * _REQUIRE_ := The file with required packages; defaults to requirements.txt\n * _TESTDIR_ := Default is current directory 'tests'\n\n## Targets\n\n### env\nCreate the virtual environment in `venv` directory within the current directory.  No stomping on other virtual environments in some global directory.  Let's keep everything local to make environment debugging easier.  This is also where all the requirements are installed.\n\nYou can specify the python interpreter version by adding python=PYTHON_EXE on the command-line.  This defaults to the current python interpreter.\n\nExamples:\n``` bash\n    $ make env python=python2.7\n    $ make env python=python3.4m\n```\n\n### check\nStatic code analysis using pylint, ignoring the virtual environment.\n\n### test\nRun all the tests in TESTDIR.  By default, I am using pytest, but you can fix this by changing TEST_RUNNER and TEST_RUNNER_PKGS.\n\nYou can also pass arguments to your TEST_RUNNER by adding `args=\" ... \"` on the command line.\n\nExamples:\n``` bash\n    $ make test args=\"-v\"\n    $ make test args=\"-x --pdb --ff\"\n```\n\n### coverage\nIt runs your tests observing if they execute the entire code base.  It then creates a terminal report with lines that missed coverage.  You can pass additional arguments to coverage use the `arg` command line just like in test.  To permanently change argument, modify the `COVER_ARG` argument in Makefile.\n\nIf `PACKAGE` is empty, python files are in the same directory as Makefile, you should use a coverage config file to omit the virtual environment directory from the coverage search.  In this case, Makefile will create a `default.coveragerc` file for you and then stop make execution.  When you rerun make it will find the `default.coveragerc` and append \"--cov-config default.coveragerc\" to `COVER_ARG`.\n\nHere is the created `default.coveragerc` with a placeholder for your environment directory.\n\n```\n[run]\nomit=${ENV}/*\n```\n\n### clean clean-all\nThe target clean removes everything but environment and clean-all removes the environment.\n\n### upload\nPackage the module and upload it PyPI.\n\n## Testing Makefile\nTo keep me from breaking functionality, I needed some testing scripts.  These tests both instances where source files are in the same directory as the Make file and where source files are in a separate directory.\n\n  * _all.sh_: Run all the tests.\n  * _environment.sh_: verify proper virtualenv creation by target **env**\n  * _checking.sh_: verify static code analysis by target **check**\n  * _coverage.sh_: verify testing and coverage working by target **coverage**\n  * _travis.sh_: verify it works properly under Travis-ci.org environment\n\n## Other files\n\n### travis.yml\nA simple `.travis.yml` for python versions 2.7, 3.3, 3.4, and 3.6 in continuous integration testing.  I am not using 3.5 as wheel is giving me some problems when compiling dependencies.  It is already set to use [coveralls](coveralls.io), so go to coveralls.io and hook up your project and travis-ci will send the run information for coverage analysis.\n\n### .pypirc\nThe authentication file I use for uploading modules to PyPI.  Of course I have stripted out the username and passwords.\n\n### gitignore\nHere is the `.gitignore` file I use.  I am not sure about the source of inspiration, but I have been using this for quite awhile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjidn%2Fpython-makefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjidn%2Fpython-makefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjidn%2Fpython-makefile/lists"}