-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Released to PyPI. Version bumped to 1.1.0.
Released to PyPI. Version number bumped to v1.1.0. Version number now available as a static function.
- Loading branch information
1 parent
0e71992
commit 6c860b1
Showing
6 changed files
with
72 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ authors: | |
affiliation: University of Manchester, UK | ||
email: [email protected] | ||
website: https://alexhenderson.info | ||
version: v1.0.0 | ||
date-released: "2022-02-09" | ||
version: v1.1.0 | ||
date-released: "2022-03-05" | ||
license: MIT | ||
license-url: https://spdx.org/licenses/MIT#licenseText | ||
repository: "https://github.com/AlexHenderson/hasher/" | ||
repository: "https://github.com/AlexHenderson/hasher" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,7 @@ | |
Python package to generate a stable hash value for either a single file, or a folder containing many files and | ||
sub-folders. | ||
|
||
Requires Python 3.7 or higher. | ||
|
||
Features: | ||
## Features ## | ||
- The default hash type is `sha256`, although the user can specify any valid hash type provided by `hashlib`. | ||
- A single hash is generated from a folder, regardless of how many files and sub-folders it contains. | ||
- For a single file, the filename can be included into the hash if required (default is not to include). | ||
|
@@ -108,11 +106,19 @@ output | |
hash name: md5 | ||
hash digest: f2865fa...<snip>...6679c3 | ||
|
||
## Requirements ## | ||
|
||
python >= 3.7 | ||
pytest | ||
|
||
### Installation ### | ||
|
||
pip install hasher-AlexHenderson==1.1.0 | ||
|
||
|
||
## Usage rights ## | ||
Copyright (c) 2022 Alex Henderson ([email protected]) | ||
Licensed under the MIT License. See https://opensource.org/licenses/MIT | ||
SPDX-License-Identifier: MIT | ||
Version 1.0.0 | ||
See https://github.com/AlexHenderson/hasher/ for the most recent version | ||
|
||
Version 1.1.0 | ||
See https://github.com/AlexHenderson/hasher for the most recent version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"wheel" | ||
] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pytest~=7.0.1 | ||
setuptools~=60.9.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from setuptools import setup, find_packages | ||
|
||
|
||
with open("README.md", "r", encoding="utf-8") as fh: | ||
long_description = fh.read() | ||
|
||
setup( | ||
name="hasher-AlexHenderson", | ||
version="1.1.0", | ||
author="Alex Henderson", | ||
author_email="[email protected]", | ||
description="Python package to generate a stable hash value for either a single file, or a folder containing many " | ||
"files and sub-folders.", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/AlexHenderson/hasher", | ||
project_urls={ | ||
"Bug Tracker": "https://github.com/AlexHenderson/hasher/issues", | ||
}, | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
], | ||
package_dir={"": "src"}, | ||
packages=find_packages(where="src"), | ||
python_requires=">=3.7", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# Copyright (c) 2022 Alex Henderson ([email protected]) | ||
# Licensed under the MIT License. See https://opensource.org/licenses/MIT | ||
# SPDX-License-Identifier: MIT | ||
# Version 1.0.0 | ||
# Version 1.1.0 | ||
# See https://github.com/AlexHenderson/hasher for the most recent version | ||
|
||
import hashlib | ||
|
@@ -61,14 +61,28 @@ class Hasher: | |
Copyright (c) 2022 Alex Henderson ([email protected]) | ||
Licensed under the MIT License. See https://opensource.org/licenses/MIT | ||
SPDX-License-Identifier: MIT | ||
Version 1.0.0 | ||
Version 1.1.0 | ||
See https://github.com/AlexHenderson/hasher for the most recent version | ||
""" | ||
|
||
# Define the version of this code | ||
_version = "1.1.0" | ||
|
||
# Define the default type of hash as 'sha256' | ||
_default_hash_type = 'sha256' | ||
|
||
@classmethod | ||
def version(cls) -> str: | ||
""" | ||
Returns the version number of this code. | ||
:return: The version number. | ||
:rtype: str | ||
""" | ||
|
||
return Hasher._version | ||
|
||
@classmethod | ||
def default_hash_type(cls) -> str: | ||
""" | ||
|
@@ -77,7 +91,7 @@ def default_hash_type(cls) -> str: | |
:return: The default hash type. | ||
:rtype: str | ||
""" | ||
|
||
return Hasher._default_hash_type | ||
|
||
@classmethod | ||
|
@@ -189,7 +203,7 @@ def generate(self, | |
logging.info(f"Hasher >>>>>>") | ||
|
||
# Log the version of this source code | ||
logging.info(f"Version: 1.0.0") | ||
logging.info(f"Version: {Hasher._version}") | ||
|
||
try: | ||
# Normalise input | ||
|