-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from nasa/implement-pre-commit-hooks
- Loading branch information
Showing
31 changed files
with
2,796 additions
and
2,243 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# For more information, see: | ||
# https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view | ||
|
||
# Black code formatting of entire repository | ||
036cf6f687ae8c07f381c1537bdb527219558e10 |
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
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,20 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-json | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.3.4 | ||
hooks: | ||
- id: ruff | ||
args: ["--fix", "--show-fixes"] | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 24.3.0 | ||
hooks: | ||
- id: black-jupyter | ||
args: ["--skip-string-normalization"] | ||
language_version: python3.11 |
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
2.2.0 | ||
2.2.1 |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
coverage ~= 5.5 | ||
ipython ~= 8.0.1 | ||
jsonschema ~= 4.17.3 | ||
pre-commit ~= 3.7.0 | ||
pycodestyle ~= 2.11.0 | ||
pylint >= 2.5.0 | ||
unittest-xml-reporting ~= 3.0.4 |
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
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
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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
https://pypi.org/pypi?%3Aaction=list_classifiers | ||
""" | ||
|
||
from typing import List | ||
import io | ||
import pathlib | ||
|
@@ -16,28 +17,29 @@ | |
|
||
|
||
def parse_dependencies(file_path: str) -> List[str]: | ||
""" Parse a Pip requirements file, and extract the dependencies. """ | ||
"""Parse a Pip requirements file, and extract the dependencies.""" | ||
with open(file_path, 'r') as file_handler: | ||
dependencies = file_handler.read().strip().split('\n') | ||
|
||
return dependencies | ||
|
||
|
||
def get_readme(current_directory: str) -> str: | ||
""" Parse the README.md in the root of the repository, for the long | ||
description of this Python package. | ||
"""Parse the README.md in the root of the repository, for the long | ||
description of this Python package. | ||
""" | ||
with io.open(os.path.join(current_directory, 'README.md'), | ||
'r', encoding='utf-8') as file_handler: | ||
with io.open( | ||
os.path.join(current_directory, 'README.md'), 'r', encoding='utf-8' | ||
) as file_handler: | ||
readme = file_handler.read() | ||
|
||
return readme | ||
|
||
|
||
def get_semantic_version(current_directory: str) -> str: | ||
""" Parse the VERSION file in the root of the repository for the semantic | ||
version number of the version. | ||
"""Parse the VERSION file in the root of the repository for the semantic | ||
version number of the version. | ||
""" | ||
with open(os.path.join(current_directory, 'VERSION'), 'r') as file_handler: | ||
|
@@ -51,9 +53,11 @@ def get_semantic_version(current_directory: str) -> str: | |
version=get_semantic_version(CURRENT_DIRECTORY), | ||
author='NASA EOSDIS SDPS Data Services Team', | ||
author_email='[email protected]', | ||
description=('A package for parsing Earth Observation science granule ' | ||
'structure and extracting relations between science variables' | ||
' and their associated metadata, such as coordinates.'), | ||
description=( | ||
'A package for parsing Earth Observation science granule ' | ||
'structure and extracting relations between science variables' | ||
' and their associated metadata, such as coordinates.' | ||
), | ||
long_description=get_readme(CURRENT_DIRECTORY), | ||
long_description_content_type='text/markdown', | ||
url='https://github.com/nasa/earthdata-varinfo', | ||
|
@@ -64,7 +68,9 @@ def get_semantic_version(current_directory: str) -> str: | |
test_suite='tests', | ||
python_requires='>=3.7', | ||
license='License :: OSI Approved :: Apache Software License', | ||
classifiers=['Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Operating System :: OS Independent'], | ||
classifiers=[ | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Operating System :: OS Independent', | ||
], | ||
) |
Oops, something went wrong.