Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Final release before archiving
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmundGoodman committed Jul 31, 2023
1 parent d24d210 commit 51fa9ab
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 37 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
![Build status](https://github.com/EdmundGoodman/Jupyter_Pylinter/actions/workflows/python-app.yml/badge.svg)
[![Code coverage](https://codecov.io/gh/EdmundGoodman/Jupyter_Pylinter/branch/main/graph/badge.svg?token=5XL3ZX71OJ)](https://codecov.io/gh/EdmundGoodman/Jupyter_Pylinter)

# Jupyter Pylinter
# Jupyter Pylinter - Archived

***This project is archived, and no longer under active development.***

**Please consider using [https://github.com/nbQA-dev/nbQA](https://github.com/nbQA-dev/nbQA) instead**

A simple tool to extract python code from a Jupyter notebook, and then run
pylint on it for static analysis.
Expand Down
56 changes: 41 additions & 15 deletions jupylint/jupylint.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
__copyright__ = "Copyright 2021"
__credits__ = ["Edmund Goodman"]
__license__ = "MIT"
__version__ = "2.2.2"
__version__ = "2.2.3"
__maintainer__ = "Edmund Goodman"
__email__ = "egoodman3141@gmail.com"
__status__ = "Production"
Expand All @@ -26,26 +26,50 @@ class OldJupyterVersionError(Exception):

class Jupylint:
"""The tool to extract from Jupyter notebooks and run pylint"""

CELL_SEPARATOR = "# " + ("=" * 78) + "\n"
DEFAULT_OUT_FILE = ".jupylint_tmp_out.py"

@staticmethod
def get_arguments():
"""Parse keyword arguments for the tool"""
parser = ArgumentParser(description="""A simple tool to extract
parser = ArgumentParser(
description="""A simple tool to extract
python code from a Jupyter notebook, and then run pylint on it for static
analysis.""")
parser.add_argument("in_file_name", metavar="input_file_name", type=str,
nargs=1, help="the name of the Jupyter notebook file to extract the code from")
parser.add_argument("out_file_name", metavar="output_file_name", type=str,
nargs="?", default=Jupylint.DEFAULT_OUT_FILE,
help="the name of the output file to write the extracted code to")
parser.add_argument("-k", "--keep", dest="save_file", action="store_true",
help="a boolean specifying whether to keep or delete the extracted python file")
parser.add_argument("--rcfile", metavar="rcfile", type=str,
nargs=1, help="the pylintrc file to use")
parser.add_argument("-v", "--version", action="version",
version=f"%(prog)s {__version__}")
analysis."""
)
parser.add_argument(
"in_file_name",
metavar="input_file_name",
type=str,
nargs=1,
help="the name of the Jupyter notebook file to extract the code from",
)
parser.add_argument(
"out_file_name",
metavar="output_file_name",
type=str,
nargs="?",
default=Jupylint.DEFAULT_OUT_FILE,
help="the name of the output file to write the extracted code to",
)
parser.add_argument(
"-k",
"--keep",
dest="save_file",
action="store_true",
help="a boolean specifying whether to keep or delete the extracted python file",
)
parser.add_argument(
"--rcfile",
metavar="rcfile",
type=str,
nargs=1,
help="the pylintrc file to use",
)
parser.add_argument(
"-v", "--version", action="version", version=f"%(prog)s {__version__}"
)
return parser.parse_args()

@staticmethod
Expand All @@ -56,7 +80,9 @@ def get_json_content(in_file_name):
json_content = load(in_file)
if json_content["nbformat"] >= 4:
return json_content["cells"]
raise OldJupyterVersionError(f"The Jupyter version of '{in_file_name}' is too old (<=4.0)")
raise OldJupyterVersionError(
f"The Jupyter version of '{in_file_name}' is too old (<=4.0)"
)

@staticmethod
def get_code_content(json_content):
Expand Down
40 changes: 19 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,28 @@
long_description = fh.read()

setup(
name = 'jupylint',
version = '2.2.2',
license='MIT',
description = 'A tool to run pylint on Jupyter notebooks',
name="jupylint",
version="2.2.3",
license="MIT",
description="A tool to run pylint on Jupyter notebooks",
long_description=long_description,
long_description_content_type="text/markdown",
author = 'Edmund Goodman',
author_email = 'egoodman3141@gmail.com',
url = 'https://github.com/EdmundGoodman/Jupyter_Pylinter',
download_url = 'https://github.com/EdmundGoodman/Jupyter_Pylinter/archive/refs/tags/v2.2.2.tar.gz',
author="Edmund Goodman",
author_email="egoodman3141@gmail.com",
url="https://github.com/EdmundGoodman/Jupyter_Pylinter",
download_url="https://github.com/EdmundGoodman/Jupyter_Pylinter/archive/refs/tags/v2.2.3.tar.gz",
packages=find_packages(),
entry_points = {
"console_scripts": ['jupylint = jupylint.jupylint:main']
},
keywords = ['Jupyter', 'Pylint', 'linter'],
install_requires = ['pylint'],
entry_points={"console_scripts": ["jupylint = jupylint.jupylint:main"]},
keywords=["Jupyter", "Pylint", "linter"],
install_requires=["pylint"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
"Development Status :: 7 - Inactive",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
)

0 comments on commit 51fa9ab

Please sign in to comment.