From 5fa5ce722c5d5d352f9c04bb5da00cd3b0dd86ec Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 03:55:07 -0500 Subject: [PATCH 01/15] switch to flit backend --- .flake8 | 17 ++++++++ .git-blame-ignore-revs | 2 + readthedocs.yml => .readthedocs.yml | 0 MANIFEST.in | 29 ------------ Makefile | 2 +- pyproject.toml | 48 ++++++++++++++++++-- setup.cfg | 68 ----------------------------- 7 files changed, 65 insertions(+), 101 deletions(-) create mode 100644 .flake8 create mode 100644 .git-blame-ignore-revs rename readthedocs.yml => .readthedocs.yml (100%) delete mode 100644 MANIFEST.in delete mode 100644 setup.cfg diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..9b3bcc97 --- /dev/null +++ b/.flake8 @@ -0,0 +1,17 @@ +[flake8] +ignore = "E501, W503, E402" +builtins = "c, get_config" +exclude = """ +.cache, +.github, +docs, +setup.py""" +enable-extensions = "G" +extend-ignore = """ +G001, G002, G004, G200, G201, G202, +# black adds spaces around ':' +E203,""" +per-file-ignores = """ +# B011: Do not call assert False since python -O removes these calls +# F841 local variable 'foo' is assigned to but never used +tests/*: B011, F841""" diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000..b8d0fc4b --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Run AutoFormatters: https://github.com/blink1073/oct2py/pull/232 +00192f2cd97f2395cfce8af69ba3671ae0cb70b1 diff --git a/readthedocs.yml b/.readthedocs.yml similarity index 100% rename from readthedocs.yml rename to .readthedocs.yml diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 90650085..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,29 +0,0 @@ -include *.txt -include *.rst -include Makefile -include *.md -include *.yml -include .coveragerc -include pytest.ini - -recursive-include docs *.rst -recursive-include docs *.png -recursive-include docs *.py -recursive-include oct2py *.m -recursive-include example *.m -recursive-include example *.py -recursive-include example *.ipynb -recursive-include numpydoc *.py -recursive-include licenses *.txt -recursive-include docs *.bat -recursive-include docs *.html -recursive-include docs *.yml -recursive-include docs Makefile -recursive-include oct2py *.txt - -prune .git -prune docs/_build -prune dist -prune build - -exclude .pre-commit-config.yaml diff --git a/Makefile b/Makefile index 8fd458e1..81ed08a2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Note: This is meant for Oct2Py developer use only -.PHONY: all clean test cover release gh-pages docs +.PHONY: all clean test cover release docs NAME:=$(shell python setup.py --name 2>/dev/null) VERSION:=$(shell python setup.py --version 2>/dev/null) diff --git a/pyproject.toml b/pyproject.toml index fef6ace6..faeebc3b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,51 @@ [build-system] -requires = ["setuptools>=46.4.0", "wheel", "packaging", "numpy", "octave_kernel"] -build-backend = "setuptools.build_meta" +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "oct2py" +description = "'Python to GNU Octave bridge --> run m-files from python.'" +license = {text = "MIT"} +authors = [{name = "Steven Silvester", email = "steven.silvester@ieee.org"}] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering", + "Topic :: Software Development", +] +requires-python = ">=3.7" +dependencies = [ + "numpy >=1.12", + "scipy >=0.17", + "octave_kernel >= 0.34.0", +] +dynamic = ["version"] +readme = "README.rst" + +[project.urls] +Home = "http://github.com/blink1073/oct2py" + +[project.optional-dependencies] +test = [ + "pytest", + "pandas", + "nbconvert", + "pytest-timeout", + "pre-commit", +] +docs = [ + "sphinx", + "sphinx-bootstrap-theme", + "numpydoc", +] [tool.jupyter-releaser] -skip = ["check-links"] +skip = ["check-links", "check-manifest"] [tool.jupyter-releaser.hooks] before-build-python = ["sudo apt-get update", "sudo apt-get install -qq octave octave-signal liboctave-dev"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 8e601081..00000000 --- a/setup.cfg +++ /dev/null @@ -1,68 +0,0 @@ -[metadata] -name = oct2py -version = attr: oct2py._version.__version__ -description = 'Python to GNU Octave bridge --> run m-files from python.' -long_description = file: README.rst -long_description_content_type = text/x-rst -license = MIT -author = Steven Silvester -author_email = steven.silvester@ieee.org -url = http://github.com/blink1073/oct2py -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - Intended Audience :: Science/Research - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3 - Topic :: Scientific/Engineering - Topic :: Software Development - -[options] -zip_safe = False -include_package_data = True -packages = find: -python_requires = >=3.7 -install_requires = - numpy >=1.12 - scipy >=0.17 - octave_kernel >= 0.34.0 - -[options.extras_require] -test = - pytest - pandas - nbconvert - pytest-timeout - pre-commit -docs = - sphinx - sphinx-bootstrap-theme - numpydoc - -[build_sphinx] -source-dir = docs -build-dir = docs/build -all_files = 1 - -[upload_sphinx] -upload-dir = docs/build/html - -[flake8] -ignore = E501, W503, E402 -builtins = c, get_config -exclude = - .cache, - .github, - docs, - setup.py -enable-extensions = G -extend-ignore = - G001, G002, G004, G200, G201, G202, - # black adds spaces around ':' - E203, -per-file-ignores = - # B011: Do not call assert False since python -O removes these calls - # F841 local variable 'foo' is assigned to but never used - tests/*: B011, F841 From e9ebe72c8034435b60162a4c4bdaec927fbf6f88 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:03:01 -0500 Subject: [PATCH 02/15] clean up flake8 and version handling --- .flake8 | 31 +++++++++++++++++-------------- docs/source/conf.py | 11 +++-------- pyproject.toml | 10 +++++++++- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.flake8 b/.flake8 index 9b3bcc97..09188bae 100644 --- a/.flake8 +++ b/.flake8 @@ -1,17 +1,20 @@ [flake8] -ignore = "E501, W503, E402" +ignore = E501, W503, E402 builtins = "c, get_config" -exclude = """ -.cache, -.github, -docs, -setup.py""" +exclude = [ + .cache, + .github, + docs, + setup.py +] enable-extensions = "G" -extend-ignore = """ -G001, G002, G004, G200, G201, G202, -# black adds spaces around ':' -E203,""" -per-file-ignores = """ -# B011: Do not call assert False since python -O removes these calls -# F841 local variable 'foo' is assigned to but never used -tests/*: B011, F841""" +extend-ignore = [ + G001, G002, G004, G200, G201, G202, + # black adds spaces around ':' + E203 +] +per-file-ignores = [ + # B011: Do not call assert False since python -O removes these calls + # F841 local variable 'foo' is assigned to but never used + tests/*: B011, F841 +] diff --git a/docs/source/conf.py b/docs/source/conf.py index 121624f3..bd0b9a0f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -11,7 +11,6 @@ # serve to show the default. import datetime -import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -46,16 +45,12 @@ project = "Oct2Py" copyright = f"2011 - {datetime.date.today().year}, Oct2Py contributors" -_version_py = os.path.join("..", "..", "oct2py", "_version.py") -version_ns = {} - -with open(_version_py) as version_file: - exec(version_file.read(), version_ns) +version = "5.5.1" # The short X.Y version. -version = "%i.%i" % version_ns["version_info"][:2] +version = ".".join(version.split(".")[:2]) # The full version, including alpha/beta/rc tags. -release = version_ns["__version__"] +release = version # The language for content autogenerated by Sphinx. Refer to documentation diff --git a/pyproject.toml b/pyproject.toml index faeebc3b..66679499 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "oct2py" +version = "5.5.1" description = "'Python to GNU Octave bridge --> run m-files from python.'" license = {text = "MIT"} authors = [{name = "Steven Silvester", email = "steven.silvester@ieee.org"}] @@ -24,7 +25,6 @@ dependencies = [ "scipy >=0.17", "octave_kernel >= 0.34.0", ] -dynamic = ["version"] readme = "README.rst" [project.urls] @@ -61,10 +61,18 @@ regex = ''' message_template = "Bump to {new_version}" tag_template = "v{new_version}" +[[tool.tbump.file]] +src = "pyproject.toml" +version_template = '({major}, {minor}, {micro}, "{releaselevel}", {serial})' + [[tool.tbump.file]] src = "oct2py/_version.py" version_template = '({major}, {minor}, {micro}, "{releaselevel}", {serial})' +[[tool.tbump.file]] +src = "docs/source/conf.py" +version_template = '({major}, {minor}, {micro}, "{releaselevel}", {serial})' + [[tool.tbump.field]] name = "releaselevel" default = "final" From 44a171f16a3ec5e0cc528486c8246fcee0082ab2 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:08:49 -0500 Subject: [PATCH 03/15] update version handling --- oct2py/_version.py | 4 ++-- pyproject.toml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/oct2py/_version.py b/oct2py/_version.py index f1745050..a1e8686b 100644 --- a/oct2py/_version.py +++ b/oct2py/_version.py @@ -5,9 +5,9 @@ VersionInfo = namedtuple("VersionInfo", ["major", "minor", "micro", "releaselevel", "serial"]) -version_info = VersionInfo(5, 5, 1, "final", 0) +version_info = VersionInfo(5, 5, 1, "", 0) __version__ = f"{version_info.major}.{version_info.minor}.{version_info.micro}" -if version_info.releaselevel != "final": +if version_info.releaselevel: __version__ += f"{version_info.releaselevel}{version_info.serial}" diff --git a/pyproject.toml b/pyproject.toml index 66679499..edd93832 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ tag_template = "v{new_version}" [[tool.tbump.file]] src = "pyproject.toml" -version_template = '({major}, {minor}, {micro}, "{releaselevel}", {serial})' +version_template = '{major}.{minor}.{micro}{releaselevel}{serial}' [[tool.tbump.file]] src = "oct2py/_version.py" @@ -71,11 +71,11 @@ version_template = '({major}, {minor}, {micro}, "{releaselevel}", {serial})' [[tool.tbump.file]] src = "docs/source/conf.py" -version_template = '({major}, {minor}, {micro}, "{releaselevel}", {serial})' +version_template = '{major}{minor}{micro}{releaselevel}{serial}' [[tool.tbump.field]] name = "releaselevel" -default = "final" +default = "" [[tool.tbump.field]] name = "serial" From 21fb85d34044e25699657084cc6f4db6501bb439 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:12:29 -0500 Subject: [PATCH 04/15] fix up version handling --- oct2py/_version.py | 2 +- pyproject.toml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/oct2py/_version.py b/oct2py/_version.py index a1e8686b..7556ccfa 100644 --- a/oct2py/_version.py +++ b/oct2py/_version.py @@ -5,7 +5,7 @@ VersionInfo = namedtuple("VersionInfo", ["major", "minor", "micro", "releaselevel", "serial"]) -version_info = VersionInfo(5, 5, 1, "", 0) +version_info = VersionInfo(5, 5, 1, "", "") __version__ = f"{version_info.major}.{version_info.minor}.{version_info.micro}" diff --git a/pyproject.toml b/pyproject.toml index edd93832..bb055f49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ before-check-links = ["sudo apt-get update", "sudo apt-get install -qq octave oc [tool.tbump.version] current = "5.5.1" regex = ''' - (?P\d+)\.(?P\d+)\.(?P\d+)(?P[a-z]+)?(?P\d+)? + (?P\d+)\.(?P\d+)\.(?P\d+)(?P[a-z]+)?(?P[a-z]+)? ''' [tool.tbump.git] @@ -67,11 +67,11 @@ version_template = '{major}.{minor}.{micro}{releaselevel}{serial}' [[tool.tbump.file]] src = "oct2py/_version.py" -version_template = '({major}, {minor}, {micro}, "{releaselevel}", {serial})' +version_template = '({major}, {minor}, {micro}, "{releaselevel}", "{serial}")' [[tool.tbump.file]] src = "docs/source/conf.py" -version_template = '{major}{minor}{micro}{releaselevel}{serial}' +version_template = '{major}.{minor}.{micro}{releaselevel}{serial}' [[tool.tbump.field]] name = "releaselevel" @@ -79,7 +79,7 @@ default = "" [[tool.tbump.field]] name = "serial" -default = 0 +default = "" [tool.pytest.ini_options] testpaths = "oct2py" From d57ecf21a42c340fd2ebfc240dbbbab0b4882d17 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:21:09 -0500 Subject: [PATCH 05/15] clean up rtd --- .readthedocs.yml | 4 ---- docs/environment.yml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 044f1457..004a03ae 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,6 +1,2 @@ conda: file: docs/environment.yml -python: - version: 3 - pip_install: false - setup_py_install: false diff --git a/docs/environment.yml b/docs/environment.yml index f346ff52..4360d06c 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -2,7 +2,7 @@ name: oct2py_documentation channels: - conda-forge dependencies: - - python=3.5 + - python=3.9 - sphinx>=1.8 - sphinx_rtd_theme - numpydoc From 6f7a397f5a49703384f73cd8a84ebfef60b47ed4 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:24:38 -0500 Subject: [PATCH 06/15] use myst parser --- Makefile | 2 +- docs/environment.yml | 2 +- docs/source/conf.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 81ed08a2..c56fce22 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,6 @@ release: release_prep twine upload dist/* docs: clean - pip install -q sphinx-rtd-theme numpydoc sphinx + pip install -q sphinx-rtd-theme numpydoc sphinx myst-parser export SPHINXOPTS=-W; make -C docs html export SPHINXOPTS=-W; make -C docs linkcheck || export SPHINXOPTS=-W; make -C docs linkcheck diff --git a/docs/environment.yml b/docs/environment.yml index 4360d06c..d36f98c2 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -6,4 +6,4 @@ dependencies: - sphinx>=1.8 - sphinx_rtd_theme - numpydoc - - recommonmark + - myst-parser diff --git a/docs/source/conf.py b/docs/source/conf.py index bd0b9a0f..0915a345 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -24,6 +24,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ + "myst_parser", "sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.todo", From daa718a04fb50cf78eae1a36d5c5e7233347d64b Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:26:27 -0500 Subject: [PATCH 07/15] remove numpydoc dep --- Makefile | 2 +- docs/environment.yml | 1 - docs/source/conf.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c56fce22..1a04d51f 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,6 @@ release: release_prep twine upload dist/* docs: clean - pip install -q sphinx-rtd-theme numpydoc sphinx myst-parser + pip install -q sphinx-rtd-theme sphinx myst-parser export SPHINXOPTS=-W; make -C docs html export SPHINXOPTS=-W; make -C docs linkcheck || export SPHINXOPTS=-W; make -C docs linkcheck diff --git a/docs/environment.yml b/docs/environment.yml index d36f98c2..31196058 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -5,5 +5,4 @@ dependencies: - python=3.9 - sphinx>=1.8 - sphinx_rtd_theme - - numpydoc - myst-parser diff --git a/docs/source/conf.py b/docs/source/conf.py index 0915a345..91ed748b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -25,12 +25,12 @@ # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ "myst_parser", + "sphinx.ext.napoleon", "sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.todo", "sphinx.ext.intersphinx", "sphinx.ext.inheritance_diagram", - "numpydoc", ] # Add any paths that contain templates here, relative to this directory. From 8d0f70af5f378768262060df5b6500c6f8efb559 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:37:08 -0500 Subject: [PATCH 08/15] sphinx fix --- oct2py/utils.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/oct2py/utils.py b/oct2py/utils.py index b946bafc..fa3c9acc 100644 --- a/oct2py/utils.py +++ b/oct2py/utils.py @@ -21,12 +21,6 @@ def get_log(name=None): ---------- name : str Name of the log. - - References - ---------- - .. [1] Logging facility for Python, - http://docs.python.org/library/logging.html - """ if name is None: name = "oct2py" From c8a1baf1eb505b27d3bda60af4e345952358cdde Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:40:11 -0500 Subject: [PATCH 09/15] clean up ci --- .github/workflows/tests.yml | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ed11d9c3..f305c4f7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,8 +20,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Base Setup - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install Octave run: | sudo apt-get update @@ -29,15 +28,6 @@ jobs: - name: Install dependencies run: | make install - - name: Run test - run: | - xvfb-run --auto-servernum make test - - name: Generate Docs - run: | - make docs - - name: Make sure the package is release-able - run: | - make release_prep - name: Generate coverage report run: | xvfb-run --auto-servernum make cover @@ -49,11 +39,19 @@ jobs: flags: unittests name: codecov-umbrella fail_ci_if_error: true - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml - flags: unittests - name: codecov-umbrella - fail_ci_if_error: true + + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: Generate Docs + run: make docs + + release_prep: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: Make sure the package is release-able + run: make release_prep From 9f4427624cdd14851d519735b72acf1dee51ee0c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:41:34 -0500 Subject: [PATCH 10/15] clean up ci --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f305c4f7..099cb8a2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,6 +45,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: Install Oct2py + run: make install - name: Generate Docs run: make docs @@ -53,5 +55,7 @@ jobs: steps: - uses: actions/checkout@v2 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: Install Oct2py + run: make install - name: Make sure the package is release-able run: make release_prep From 846819845a24e9becaf9456a879792c19887dacf Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:44:18 -0500 Subject: [PATCH 11/15] clean up release_prep --- .github/workflows/tests.yml | 4 ++-- Makefile | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 099cb8a2..5aebdb7b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,7 +46,7 @@ jobs: - uses: actions/checkout@v2 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install Oct2py - run: make install + run: pip install . - name: Generate Docs run: make docs @@ -56,6 +56,6 @@ jobs: - uses: actions/checkout@v2 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install Oct2py - run: make install + run: pip install . - name: Make sure the package is release-able run: make release_prep diff --git a/Makefile b/Makefile index 1a04d51f..55ac4388 100644 --- a/Makefile +++ b/Makefile @@ -33,10 +33,9 @@ cover: clean pytest --doctest-modules -l --cov-report html --cov-report=xml --cov=${NAME} release_prep: clean - pip install -q wheel twine + pip install -q build twine git commit -a -m "Release ${VERSION}"; true - python setup.py bdist_wheel --universal - python setup.py sdist + python -m build . twine check dist/* release: release_prep From 0f6d0061d13639d2a0b8599af76e6cff21a23d4c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:46:47 -0500 Subject: [PATCH 12/15] gracefully handle engine startup failure --- oct2py/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oct2py/core.py b/oct2py/core.py index 5486ccec..243d1982 100644 --- a/oct2py/core.py +++ b/oct2py/core.py @@ -559,7 +559,10 @@ def restart(self): if "OCTAVE_EXECUTABLE" not in os.environ and "OCTAVE" in os.environ: os.environ["OCTAVE_EXECUTABLE"] = os.environ["OCTAVE"] - self._engine = OctaveEngine(stdin_handler=self._handle_stdin, logger=self.logger) + try: + self._engine = OctaveEngine(stdin_handler=self._handle_stdin, logger=self.logger) + except Exception as e: + raise Oct2PyError(str(e)) # Add local Octave scripts. self._engine.eval('addpath("%s");' % HERE.replace(osp.sep, "/")) From 58597a9e1cd5d9f058302a2fc9d4a268d1f9cd19 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 04:53:22 -0500 Subject: [PATCH 13/15] more cleanup --- .coveragerc | 2 -- .flake8 | 3 +-- .github/workflows/tests.yml | 4 ++-- Makefile | 11 +++++------ pyproject.toml | 6 +++++- setup.py | 5 ----- 6 files changed, 13 insertions(+), 18 deletions(-) delete mode 100644 setup.py diff --git a/.coveragerc b/.coveragerc index 4c15bf0b..4157778b 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,8 +3,6 @@ [run] branch = True omit = - */setup.py - oct2py/compat.py oct2py/tests/* oct2py/ipython/tests/* diff --git a/.flake8 b/.flake8 index 09188bae..c62aab35 100644 --- a/.flake8 +++ b/.flake8 @@ -4,8 +4,7 @@ builtins = "c, get_config" exclude = [ .cache, .github, - docs, - setup.py + docs ] enable-extensions = "G" extend-ignore = [ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5aebdb7b..3f503a7d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,7 +46,7 @@ jobs: - uses: actions/checkout@v2 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install Oct2py - run: pip install . + run: make - name: Generate Docs run: make docs @@ -56,6 +56,6 @@ jobs: - uses: actions/checkout@v2 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install Oct2py - run: pip install . + run: make - name: Make sure the package is release-able run: make release_prep diff --git a/Makefile b/Makefile index 55ac4388..648f9b18 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,15 @@ # Note: This is meant for Oct2Py developer use only .PHONY: all clean test cover release docs -NAME:=$(shell python setup.py --name 2>/dev/null) -VERSION:=$(shell python setup.py --version 2>/dev/null) +NAME:="oct2py" +VERSION:="5.5.1" KILL_PROC="from ${NAME} import kill_octave; kill_octave()" all: clean - python setup.py install - + pip install -e ".[docs,test]" install: clean - pip install -e .[docs,test] + pip install -e ".[docs,test]" pre-commit install octave --eval "pkg install -forge control" octave --eval "pkg install -forge signal" @@ -45,6 +44,6 @@ release: release_prep twine upload dist/* docs: clean - pip install -q sphinx-rtd-theme sphinx myst-parser + pip install -e ".[docs]" export SPHINXOPTS=-W; make -C docs html export SPHINXOPTS=-W; make -C docs linkcheck || export SPHINXOPTS=-W; make -C docs linkcheck diff --git a/pyproject.toml b/pyproject.toml index bb055f49..e61e1f7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ test = [ docs = [ "sphinx", "sphinx-bootstrap-theme", - "numpydoc", + "myst-parser", ] [tool.jupyter-releaser] @@ -73,6 +73,10 @@ version_template = '({major}, {minor}, {micro}, "{releaselevel}", "{serial}")' src = "docs/source/conf.py" version_template = '{major}.{minor}.{micro}{releaselevel}{serial}' +[[tool.tbump.file]] +src = "Makefile" +version_template = '{major}.{minor}.{micro}{releaselevel}{serial}' + [[tool.tbump.field]] name = "releaselevel" default = "" diff --git a/setup.py b/setup.py deleted file mode 100644 index 8a4e1954..00000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Setup script for oct2py package. -""" -from setuptools import setup - -setup() From 1a9e6109af37ba23d082d9063068f85fef8b408a Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 05:14:08 -0500 Subject: [PATCH 14/15] add missing dep --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e61e1f7c..cc384400 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ docs = [ "sphinx", "sphinx-bootstrap-theme", "myst-parser", + "sphinx_rtd_theme" ] [tool.jupyter-releaser] From 916b888c13254fa07916b6bd56afd6b8f7cd80c3 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 31 Mar 2022 05:53:44 -0500 Subject: [PATCH 15/15] update links --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cc384400..dc11fd86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,8 @@ dependencies = [ readme = "README.rst" [project.urls] -Home = "http://github.com/blink1073/oct2py" +homepage = "https://github.com/blink1073/oct2py" +documentation = "https://blink1073.github.io/oct2py" [project.optional-dependencies] test = [