From 3a4ccda4e947dd5bb3d972d5d6c624d85a602642 Mon Sep 17 00:00:00 2001 From: Tom Ice Date: Sat, 28 Sep 2024 22:33:50 -0400 Subject: [PATCH] Project cleanup * Adjusted README.md for standard pip installation. Added information on how to handle multiple envs. Used absolute paths instead of relative for documentation for when it gets uploaded to other sites * Adjusted some of the information for uploading to PyPI, tweaked the version slightly * Minor tweaks and nitpicky stuff --- MANIFEST.in | 3 ++- README.md | 22 ++++++++++++++-------- git_py_stats/main.py | 4 ++-- man/git-py-stats.1 | 2 +- setup.py | 26 ++++++++++++++++---------- 5 files changed, 35 insertions(+), 22 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 9615a9d..cce1886 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,8 @@ include LICENSE include README.md include TODO.md -recursive-include git_py_stats * +recursive-include git_py_stats *.py recursive-include man * global-exclude *.pyc __pycache__/ +prune git_py_stats/tests diff --git a/README.md b/README.md index 6a455c0..71099ec 100644 --- a/README.md +++ b/README.md @@ -113,9 +113,12 @@ to the parent project: You can check your Python version with: ```bash - python3 --version + python --version ``` + If your `python` is symlinked to Python 2, you can use + [`pyenv`](https://github.com/pyenv/pyenv) to switch between Python versions. + - **Git**: Git should be installed and available in your system's `PATH`. @@ -132,11 +135,11 @@ to the parent project: 2. **Install the Package**: - You can install the package locally in editable mode. + You can install the package directly from PyPI. This allows you to run `git-py-stats` from anywhere on your system. ```bash - pip install -e . + pip install git-py-stats ``` Or you can run it locally without `pip` by doing the following @@ -158,7 +161,7 @@ to the parent project: to be done in the following manner: ```bash - python3 -m git_py_stats.main --help + python -m git_py_stats.main --help ``` ### Using `setup.py` @@ -168,7 +171,7 @@ If you prefer using `setup.py` directly: 1. **Install the Package**: ```bash - python3 setup.py install + python setup.py install ``` 2. **Verify the Installation**: @@ -306,17 +309,20 @@ export _MENU_THEME="legacy" ## Contributing We welcome contributions of all kinds! Please read our -[CONTRIBUTING.md](CONTRIBUTING.md) guide to learn how to get involved. +[CONTRIBUTING.md](https://github.com/tomice/git-py-stats/blob/main/CONTRIBUTING.md) +guide to learn how to get involved. ## Code of Conduct To ensure a positive and inclusive community, please follow our -[Code of Conduct](CODE_OF_CONDUCT.md) during your interactions. +[Code of Conduct](https://github.com/tomice/git-py-stats/blob/main/CODE_OF_CONDUCT.md) +during your interactions. ## License This project is licensed under the MIT License. -See the [LICENSE](LICENSE) file for more details. +See the [LICENSE](https://github.com/tomice/git-py-stats/blob/main/LICENSE) +file for more details. ## Author diff --git a/git_py_stats/main.py b/git_py_stats/main.py index 15b40b2..a7ccb77 100644 --- a/git_py_stats/main.py +++ b/git_py_stats/main.py @@ -26,8 +26,8 @@ def main() -> None: # Check if we are inside a Git repository if not check_git_repository(): - print("This is not a Git repository.") - print("Please navigate to a Git repository and try again.") + print("This is not a git repository.") + print("Please navigate to a git repository and try again.") sys.exit(1) # Get env config diff --git a/man/git-py-stats.1 b/man/git-py-stats.1 index 991a563..72d71b0 100644 --- a/man/git-py-stats.1 +++ b/man/git-py-stats.1 @@ -1,4 +1,4 @@ -.TH GIT-PY-STATS "1" "September 2024" "git-py-stats 0.1" "User Commands" +.TH GIT-PY-STATS "1" "September 2024" "git-py-stats 0.1.0" "User Commands" .SH NAME git-py-stats \- A Python implementation of git-quick-stats. diff --git a/setup.py b/setup.py index 8352a45..215377b 100644 --- a/setup.py +++ b/setup.py @@ -1,28 +1,34 @@ from setuptools import setup, find_packages +# Read the long description from README +with open("README.md", "r", encoding="utf-8") as fh: + long_description = fh.read() + setup( name="git-py-stats", - version="0.1", - packages=find_packages( - exclude=["*.tests", "*.tests.*", "tests.*", "tests"] - ), # Exclude test packages + version="0.1.0", + packages=find_packages(), entry_points={ "console_scripts": [ "git-py-stats=git_py_stats.main:main", ], }, - install_requires=[ - # Nothing - ], data_files=[ - # Manpages ("share/man/man1", ["man/git-py-stats.1"]), ], description="A Python Implementation of git-quick-stats", - long_description=open("README.md").read(), + long_description=long_description, long_description_content_type="text/markdown", author="Tom Ice", + author_email="contact@thomasice.com", license="MIT", url="https://github.com/tomice/git-py-stats", - python_requires=">=3.6", + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + ], + python_requires=">=3.8", + include_package_data=True, + keywords="git stats statistics command-line", )