From da5039147c043faec53a11543b01a06cf47409f5 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Mon, 12 Jul 2021 15:40:47 -0600 Subject: [PATCH] v1.4.0 --- CHANGELOG.md | 7 ++++++- Makefile | 10 +++++----- README.md | 16 +++++++++------- README_project.md | 12 ++++++------ project_name/__init__.py | 2 ++ {python_project => project_name}/my_module.py | 0 python_project/__init__.py | 2 -- setup.py | 8 ++++---- test/unit/test_my_module.py | 4 ++-- 9 files changed, 34 insertions(+), 27 deletions(-) create mode 100644 project_name/__init__.py rename {python_project => project_name}/my_module.py (100%) delete mode 100644 python_project/__init__.py diff --git a/CHANGELOG.md b/CHANGELOG.md index c8fae82..2a51b48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # CHANGELOG -# v1.3.0 (2021-05-31) +## v1.4.0 (2021-07-12) + +* Clarified various pieces of info +* Unified more text replacements for easier usage of the template when getting started + +## v1.3.0 (2021-05-31) * Pins dependencies and moves them to a constant * Adds missing lines to code coverage report diff --git a/Makefile b/Makefile index 6eb7f80..ebf1c4a 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ help: ## venv - Install the virtual environment venv: - $(VIRTUALENV) ~/.venv/python_project/ - ln -snf ~/.venv/python_project/ venv + $(VIRTUALENV) ~/.venv/project_name/ + ln -snf ~/.venv/project_name/ venv venv/bin/pip install -e ."[dev]" ## install - Install the project locally @@ -15,7 +15,7 @@ install: | venv ## clean - Remove the virtual environment and clear out .pyc files clean: - rm -rf ~/.venv/python_project/ venv + rm -rf ~/.venv/project_name/ venv find . -name '*.pyc' -delete rm -rf dist rm -rf build @@ -23,7 +23,7 @@ clean: ## lint - Lint the project lint: - venv/bin/flake8 python_project/*.py + venv/bin/flake8 project_name/*.py venv/bin/flake8 test/unit/*.py ## test - Test the project @@ -32,6 +32,6 @@ test: ## coverage - Test the project and generate an HTML coverage report coverage: - venv/bin/pytest --cov=python_project --cov-branch --cov-report=html --cov-report=term-missing + venv/bin/pytest --cov=project_name --cov-branch --cov-report=html --cov-report=term-missing .PHONY: help install clean lint test coverage diff --git a/README.md b/README.md index d7be17a..5cc3285 100644 --- a/README.md +++ b/README.md @@ -24,20 +24,22 @@ Click the `Use this template` button at the top of this project's GitHub page, i **Easy text replacements** -1. Replace all instances of `python_project` with the name of your project -1. Replace all instances of `Python Template` with the name of your project -1. Replace all instances of `PROJECT_NAME` with the name of your project -1. Replace all instances of `USERNAME` with the name of the author/owner as it appears on GitHub +1. Replace all instances of `project_name` with the name of your project + * These are the Python snake_case references (eg: `project_name`) +1. Replace all instances of `PROJECT_NAME_URL` with the name of your project + * These are the references to your project that will appear in URLs and are typically hyphenated (eg: `project-name`) +1. Replace all instances of `USERNAME` with the name of the author or owner of the project + * These are references typically found in the URL of your project as it appears on GitHub **File configuration** 1. Configure the `setup.py` file 1. Configure the `Makefile` targets -1. Update the name in the `LICENSE` +1. Update the name in the `LICENSE` or swap it out entirely 1. Configure the `.github/workflows/build.yml` file -1. Update the `CHANGELOG` -1. Replace the showcase image in `/assets` and remove all other unneeded assets 1. Change the data in `.github/FUNDING.yml` +1. Update the `CHANGELOG.md` with your own info +1. Replace the showcase image in `/assets` and remove all other unused assets 1. Rename other files/folders as needed and configure their content 1. Delete this `README` and rename `README_project.md` to `README.md` diff --git a/README_project.md b/README_project.md index a471169..659f352 100644 --- a/README_project.md +++ b/README_project.md @@ -1,13 +1,13 @@
-# Python Project +# Project Name A one-liner description of your project goes here. -[![Build Status](https://github.com/Justintime50/PROJECT_NAME/workflows/build/badge.svg)](https://github.com/Justintime50/PROJECT_NAME/actions) -[![Coverage Status](https://coveralls.io/repos/github/USERNAME/PROJECT_NAME/badge.svg?branch=main)](https://coveralls.io/github/USERNAME/PROJECT_NAME?branch=main) -[![PyPi](https://img.shields.io/pypi/v/PROJECT_NAME)](https://pypi.org/project/PROJECT_NAME) -[![Licence](https://img.shields.io/github/license/USERNAME/PROJECT_NAME)](LICENSE) +[![Build Status](https://github.com/USERNAME/PROJECT_NAME_URL/workflows/build/badge.svg)](https://github.com/USERNAME/PROJECT_NAME_URL/actions) +[![Coverage Status](https://coveralls.io/repos/github/USERNAME/PROJECT_NAME_URL/badge.svg?branch=main)](https://coveralls.io/github/USERNAME/PROJECT_NAME_URL?branch=main) +[![PyPi](https://img.shields.io/pypi/v/PROJECT_NAME_URL)](https://pypi.org/project/PROJECT_NAME_URL) +[![Licence](https://img.shields.io/github/license/USERNAME/PROJECT_NAME_URL)](LICENSE) Showcase @@ -33,7 +33,7 @@ make help Usage instructions go here. ```bash -python my_project.py +venv/bin/python my_script.py ``` ## Development diff --git a/project_name/__init__.py b/project_name/__init__.py new file mode 100644 index 0000000..3d1f411 --- /dev/null +++ b/project_name/__init__.py @@ -0,0 +1,2 @@ +# flake8: noqa +from project_name.my_module import MyModule diff --git a/python_project/my_module.py b/project_name/my_module.py similarity index 100% rename from python_project/my_module.py rename to project_name/my_module.py diff --git a/python_project/__init__.py b/python_project/__init__.py deleted file mode 100644 index 90f2ff7..0000000 --- a/python_project/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# flake8: noqa -from python_project.my_module import MyModule diff --git a/setup.py b/setup.py index 5f2daaf..6b5eba7 100644 --- a/setup.py +++ b/setup.py @@ -17,12 +17,12 @@ ] setuptools.setup( - name='PROJECT_NAME', + name='PROJECT_NAME_URL', version='1.0.0', - description='Your project description here', # noqa + description='Your project description here', long_description=long_description, long_description_content_type="text/markdown", - url='http://github.com/USERNAME/PROJECT_NAME', + url='http://github.com/USERNAME/PROJECT_NAME_URL', author='USERNAME', license='MIT', packages=setuptools.find_packages(), @@ -37,7 +37,7 @@ }, entry_points={ 'console_scripts': [ - 'PROJECT_NAME=python_project.my_module:main' + 'PROJECT_NAME_URL=project_name.my_module:main' ] }, python_requires='>=3.6', diff --git a/test/unit/test_my_module.py b/test/unit/test_my_module.py index 8294bac..de12020 100644 --- a/test/unit/test_my_module.py +++ b/test/unit/test_my_module.py @@ -1,5 +1,5 @@ import mock -from python_project.my_module import ( +from project_name.my_module import ( main, MyModule ) @@ -9,7 +9,7 @@ def test_my_function(): MyModule.my_function() -@mock.patch('python_project.my_module.MyModule.my_function') +@mock.patch('project_name.my_module.MyModule.my_function') def test_main(mock_my_function): main() mock_my_function.assert_called_once()