From 1ca214c5d7d632d193d5f67db7670a248bee2e91 Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Fri, 1 Nov 2024 18:27:52 -0500 Subject: [PATCH 01/15] Rename requirements_dev.txt to requirements.txt --- requirements_dev.txt => requirements.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename requirements_dev.txt => requirements.txt (100%) diff --git a/requirements_dev.txt b/requirements.txt similarity index 100% rename from requirements_dev.txt rename to requirements.txt From 81ca76b8fe67386a3372a836bc9ed5e636bc3400 Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Fri, 1 Nov 2024 18:30:02 -0500 Subject: [PATCH 02/15] Create test_requirements.txt --- test_requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test_requirements.txt diff --git a/test_requirements.txt b/test_requirements.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/test_requirements.txt @@ -0,0 +1 @@ + From 73556db54304a9d009b4120bc43f2c3c4191841c Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Fri, 1 Nov 2024 18:31:34 -0500 Subject: [PATCH 03/15] Update setup.py --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 34bdadd..1806c4a 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ packages=find_packages(include=["sl_forecast", "sl_forecast.*"]), test_suite="tests", tests_require=test_requirements, - url="https://github.com/audreyr/sl_forecast", - version="0.1.0", + url="https://github.com/LSSTDESC/sl_forecast", + version="0.0.0", zip_safe=False, ) From b1f5fc45e0e1faec283b577ebfb0c681f734b5fb Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Fri, 1 Nov 2024 18:36:57 -0500 Subject: [PATCH 04/15] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8272dd8..e26dc37 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,9 +36,17 @@ repos: hooks: - id: black-jupyter language_version: python3 - - repo: https://github.com/PyCQA/docformatter - rev: v1.7.5 + hooks: + - repo: local hooks: - id: docformatter - additional_dependencies: [tomli] - args: [-r, --black, --in-place] \ No newline at end of file + name: docformatter + description: Formats docstrings to follow PEP 257. + entry: python -Im docformatter + additional_dependencies: + - docformatter == 1.7.5 + args: + - --in-place + language: python + types: + - python From 6766d5864bb527b64642fa1493fc802375b6725c Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Fri, 1 Nov 2024 18:40:09 -0500 Subject: [PATCH 05/15] Update README.rst --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index 1e404a8..b596b19 100644 --- a/README.rst +++ b/README.rst @@ -13,6 +13,13 @@ SL Forecast :target: https://sl-forecast.readthedocs.io/en/latest/?version=latest :alt: Documentation Status +.. image:: https://results.pre-commit.ci/badge/github/LSSTDESC/sl_forecast/main.svg + :target: https://results.pre-commit.ci/latest/github/LSSTDESC/sl_forecast/main + :alt: pre-commit.ci status + +.. image:: https://codecov.io/gh/LSSTDESC/sl_forecast/graph/badge.svg?token=n9xsxU1rbY + :target: https://codecov.io/gh/LSSTDESC/sl_forecast + From ba6201d8f71f11228e88556d17a52a414fa4f3b3 Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Mon, 18 Nov 2024 11:52:26 -0700 Subject: [PATCH 06/15] Refactor .pre-commit-config.yaml for improved formatting and consistency --- .pre-commit-config.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b6481ba..b1dc4f4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,6 @@ repos: hooks: - id: black-jupyter language_version: python3 - hooks: - repo: local hooks: - id: docformatter @@ -44,9 +43,9 @@ repos: description: Formats docstrings to follow PEP 257. entry: python -Im docformatter additional_dependencies: - - docformatter == 1.7.5 + - docformatter == 1.7.5 args: - - --in-place + - --in-place language: python types: - - python + - python From 10bec600a63ddf400d15e4fd90d1e29777a98647 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:55:02 +0000 Subject: [PATCH 07/15] Autofix formatting from pre-commit.com hooks --- docs/conf.py | 60 +++++++++++++++++++-------------------- sl_forecast/__init__.py | 4 +-- sl_forecast/cli.py | 4 +-- tests/test_sl_forecast.py | 6 ++-- 4 files changed, 36 insertions(+), 38 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index bd0fb2b..be55ba0 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,7 +19,8 @@ # import os import sys -sys.path.insert(0, os.path.abspath('..')) + +sys.path.insert(0, os.path.abspath("..")) import sl_forecast @@ -31,22 +32,22 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] +extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] -source_suffix = '.rst' +source_suffix = ".rst" # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = 'SL Forecast' +project = "SL Forecast" copyright = "2024, Audrey Roy Greenfeld" author = "Audrey Roy Greenfeld" @@ -69,10 +70,10 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False @@ -83,7 +84,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = "alabaster" # Theme options are theme-specific and customize the look and feel of a # theme further. For a list of options available for each theme, see the @@ -94,13 +95,13 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # -- Options for HTMLHelp output --------------------------------------- # Output file base name for HTML help builder. -htmlhelp_basename = 'sl_forecastdoc' +htmlhelp_basename = "sl_forecastdoc" # -- Options for LaTeX output ------------------------------------------ @@ -109,15 +110,12 @@ # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. # # 'preamble': '', - # Latex figure (float) alignment # # 'figure_align': 'htbp', @@ -127,9 +125,13 @@ # (source start file, target name, title, author, documentclass # [howto, manual, or own class]). latex_documents = [ - (master_doc, 'sl_forecast.tex', - 'SL Forecast Documentation', - 'Audrey Roy Greenfeld', 'manual'), + ( + master_doc, + "sl_forecast.tex", + "SL Forecast Documentation", + "Audrey Roy Greenfeld", + "manual", + ), ] @@ -137,11 +139,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'sl_forecast', - 'SL Forecast Documentation', - [author], 1) -] +man_pages = [(master_doc, "sl_forecast", "SL Forecast Documentation", [author], 1)] # -- Options for Texinfo output ---------------------------------------- @@ -150,13 +148,13 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'sl_forecast', - 'SL Forecast Documentation', - author, - 'sl_forecast', - 'One line description of project.', - 'Miscellaneous'), + ( + master_doc, + "sl_forecast", + "SL Forecast Documentation", + author, + "sl_forecast", + "One line description of project.", + "Miscellaneous", + ), ] - - - diff --git a/sl_forecast/__init__.py b/sl_forecast/__init__.py index 1bc99ca..947bec7 100644 --- a/sl_forecast/__init__.py +++ b/sl_forecast/__init__.py @@ -1,5 +1,5 @@ """Top-level package for SL Forecast.""" __author__ = """Audrey Roy Greenfeld""" -__email__ = 'audreyr@example.com' -__version__ = '0.1.0' +__email__ = "audreyr@example.com" +__version__ = "0.1.0" diff --git a/sl_forecast/cli.py b/sl_forecast/cli.py index 8614752..3eb3240 100644 --- a/sl_forecast/cli.py +++ b/sl_forecast/cli.py @@ -1,4 +1,5 @@ """Console script for sl_forecast.""" + import sys import click @@ -6,8 +7,7 @@ @click.command() def main(args=None): """Console script for sl_forecast.""" - click.echo("Replace this message by putting your code into " - "sl_forecast.cli.main") + click.echo("Replace this message by putting your code into " "sl_forecast.cli.main") click.echo("See click documentation at https://click.palletsprojects.com/") return 0 diff --git a/tests/test_sl_forecast.py b/tests/test_sl_forecast.py index 8b8ce44..398ab1e 100644 --- a/tests/test_sl_forecast.py +++ b/tests/test_sl_forecast.py @@ -27,7 +27,7 @@ def test_command_line_interface(self): runner = CliRunner() result = runner.invoke(cli.main) assert result.exit_code == 0 - assert 'sl_forecast.cli.main' in result.output - help_result = runner.invoke(cli.main, ['--help']) + assert "sl_forecast.cli.main" in result.output + help_result = runner.invoke(cli.main, ["--help"]) assert help_result.exit_code == 0 - assert '--help Show this message and exit.' in help_result.output + assert "--help Show this message and exit." in help_result.output From ba10daad57d85c0a9cd314a6dbd5cccc1a084545 Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Mon, 18 Nov 2024 11:57:55 -0700 Subject: [PATCH 08/15] Remove redundant test class and methods from test_sl_forecast.py --- tests/test_sl_forecast.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/tests/test_sl_forecast.py b/tests/test_sl_forecast.py index 398ab1e..aeac8ab 100644 --- a/tests/test_sl_forecast.py +++ b/tests/test_sl_forecast.py @@ -1,33 +1,3 @@ #!/usr/bin/env python """Tests for `sl_forecast` package.""" - - -import unittest -from click.testing import CliRunner - -from sl_forecast import sl_forecast -from sl_forecast import cli - - -class TestSl_forecast(unittest.TestCase): - """Tests for `sl_forecast` package.""" - - def setUp(self): - """Set up test fixtures, if any.""" - - def tearDown(self): - """Tear down test fixtures, if any.""" - - def test_000_something(self): - """Test something.""" - - def test_command_line_interface(self): - """Test the CLI.""" - runner = CliRunner() - result = runner.invoke(cli.main) - assert result.exit_code == 0 - assert "sl_forecast.cli.main" in result.output - help_result = runner.invoke(cli.main, ["--help"]) - assert help_result.exit_code == 0 - assert "--help Show this message and exit." in help_result.output From 365ea798fcf8de40f2972f65a0193ae09b7c71c9 Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Mon, 18 Nov 2024 12:04:29 -0700 Subject: [PATCH 09/15] Remove all dependencies from requirements.txt --- requirements.txt | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/requirements.txt b/requirements.txt index e832d4d..e69de29 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +0,0 @@ -pip==19.2.3 -bump2version==0.5.11 -wheel==0.33.6 -watchdog==0.9.0 -flake8==3.7.8 -tox==3.14.0 -coverage==4.5.4 -Sphinx==1.8.5 -twine==1.14.0 -Click==7.1.2 - -black==21.7b0 From 95506a0f719f7e3cf98b81b1337e28e99a2e9b0a Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Mon, 18 Nov 2024 12:07:47 -0700 Subject: [PATCH 10/15] Update package metadata and remove CLI script; add initial test structure --- sl_forecast/__init__.py | 6 ++---- sl_forecast/cli.py | 16 ---------------- tests/test_sl_forecast.py | 10 ++++++++++ 3 files changed, 12 insertions(+), 20 deletions(-) delete mode 100644 sl_forecast/cli.py diff --git a/sl_forecast/__init__.py b/sl_forecast/__init__.py index 947bec7..ffda273 100644 --- a/sl_forecast/__init__.py +++ b/sl_forecast/__init__.py @@ -1,5 +1,3 @@ -"""Top-level package for SL Forecast.""" +"""Top-level package for sl_forecast.""" -__author__ = """Audrey Roy Greenfeld""" -__email__ = "audreyr@example.com" -__version__ = "0.1.0" +__version__ = "0.0.0" diff --git a/sl_forecast/cli.py b/sl_forecast/cli.py deleted file mode 100644 index 3eb3240..0000000 --- a/sl_forecast/cli.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Console script for sl_forecast.""" - -import sys -import click - - -@click.command() -def main(args=None): - """Console script for sl_forecast.""" - click.echo("Replace this message by putting your code into " "sl_forecast.cli.main") - click.echo("See click documentation at https://click.palletsprojects.com/") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) # pragma: no cover diff --git a/tests/test_sl_forecast.py b/tests/test_sl_forecast.py index aeac8ab..342383c 100644 --- a/tests/test_sl_forecast.py +++ b/tests/test_sl_forecast.py @@ -1,3 +1,13 @@ #!/usr/bin/env python """Tests for `sl_forecast` package.""" + +import pytest + + +class TestSLForecast: + """Tests for `sl_forecast` package.""" + + @pytest.fixture + def test_version(self): + from sl_forecast import __version__ From c85c543e98ef5e76267298f91efe7dcdcb7b38ef Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Mon, 18 Nov 2024 12:08:37 -0700 Subject: [PATCH 11/15] Add assertion to check package version in test_sl_forecast.py --- tests/test_sl_forecast.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_sl_forecast.py b/tests/test_sl_forecast.py index 342383c..423fef0 100644 --- a/tests/test_sl_forecast.py +++ b/tests/test_sl_forecast.py @@ -11,3 +11,5 @@ class TestSLForecast: @pytest.fixture def test_version(self): from sl_forecast import __version__ + + assert __version__ is not None From 5b0b5ddc6adcec094929e2c2e469f492d8368d31 Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Mon, 18 Nov 2024 12:11:45 -0700 Subject: [PATCH 12/15] Add setup and teardown methods to TestSLForecast class --- tests/test_sl_forecast.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_sl_forecast.py b/tests/test_sl_forecast.py index 423fef0..28d8357 100644 --- a/tests/test_sl_forecast.py +++ b/tests/test_sl_forecast.py @@ -8,8 +8,15 @@ class TestSLForecast: """Tests for `sl_forecast` package.""" - @pytest.fixture + def setup_class(cls): + """Setup test fixtures, if any.""" + pass + def test_version(self): from sl_forecast import __version__ assert __version__ is not None + + def teardown_class(cls): + """Teardown test fixtures, if any.""" + pass From 6965ad5db146f3b6bf4f742425e29d151596fc50 Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Mon, 18 Nov 2024 12:13:14 -0700 Subject: [PATCH 13/15] Refactor TestSLForecast class to use setup_method and remove teardown_class --- tests/test_sl_forecast.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_sl_forecast.py b/tests/test_sl_forecast.py index 28d8357..0753d64 100644 --- a/tests/test_sl_forecast.py +++ b/tests/test_sl_forecast.py @@ -5,10 +5,10 @@ import pytest -class TestSLForecast: +class TestSLForecast(object): """Tests for `sl_forecast` package.""" - def setup_class(cls): + def setup_method(self): """Setup test fixtures, if any.""" pass @@ -16,7 +16,3 @@ def test_version(self): from sl_forecast import __version__ assert __version__ is not None - - def teardown_class(cls): - """Teardown test fixtures, if any.""" - pass From 315d88cc1fee9fe625efd5d30226b19b0794b4ef Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Mon, 18 Nov 2024 12:14:14 -0700 Subject: [PATCH 14/15] Remove unused import statement from test_sl_forecast.py --- tests/test_sl_forecast.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_sl_forecast.py b/tests/test_sl_forecast.py index 0753d64..07a1ef2 100644 --- a/tests/test_sl_forecast.py +++ b/tests/test_sl_forecast.py @@ -2,8 +2,6 @@ """Tests for `sl_forecast` package.""" -import pytest - class TestSLForecast(object): """Tests for `sl_forecast` package.""" From 62157e54d3dd5d9b68b05fb89d1c0a7c22dad7b3 Mon Sep 17 00:00:00 2001 From: Anowar Shajib Date: Mon, 18 Nov 2024 12:17:14 -0700 Subject: [PATCH 15/15] Remove outdated badge images from README.rst --- README.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index b596b19..8726372 100644 --- a/README.rst +++ b/README.rst @@ -3,11 +3,8 @@ SL Forecast =========== -.. image:: https://img.shields.io/pypi/v/sl_forecast.svg - :target: https://pypi.python.org/pypi/sl_forecast - -.. image:: https://img.shields.io/travis/audreyr/sl_forecast.svg - :target: https://travis-ci.com/audreyr/sl_forecast +.. .. image:: https://img.shields.io/pypi/v/sl_forecast.svg +.. :target: https://pypi.python.org/pypi/sl_forecast .. image:: https://readthedocs.org/projects/sl-forecast/badge/?version=latest :target: https://sl-forecast.readthedocs.io/en/latest/?version=latest