Repository: CORE-GATECH-GROUP/serpent-tools (language: python)

Issue:
Drop support for python 3.5
Python 3.5 has reached it's end of life and will only be receiving security fixes starting end of September 2020 - https://www.python.org/downloads/release/python-3510/

I move that we drop support for python 3.5 in release 0.10.0, whenever that comes out.

It looks like the major linux distributions are at least on python 3.7, [debian and ubuntu at least](https://wiki.debian.org/Python), and MacOS ships with python 3.8.

As for API changes, I don't think we'll be hit with anything surprising. Some niceties we'll pick up will be better / full integration of the pathlib and typing libraries
ENH Support and test against python 3.10, 3.11
**Is your feature request related to a problem? Please describe.**
These are newer python versions that most operating systems ship by default. We should test against these.

**Describe the solution you'd like**
Users can install serpent-tools on python 3.10 and 3.11

Our CI tests against these two versions


Discussion / hints:
I think we should also drop support for 3.6, as it's long past it's end of life

py3.7 is reaching end of life this June, so I'll open a separate ticket for that


Fix patch:
diff --git a/LICENSE b/LICENSE
index a7b94d47..93fe774b 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2017-2019 Serpent-Tools Developers, GTRC
+Copyright (c) 2017-2023 Serpent-Tools Developers, GTRC
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/MANIFEST.in b/MANIFEST.in
index bc97e1a3..334ac1c8 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -3,4 +3,3 @@ include serpentTools/_version.py
 include serpentTools/variables.yaml
 include serpentTools/data/*.m
 include serpentTools/data/*.coe
-include requirements.txt
diff --git a/README.rst b/README.rst
index 068d2070..936a9eec 100644
--- a/README.rst
+++ b/README.rst
@@ -2,10 +2,6 @@
 serpent-tools
 =============
 
-.. image:: https://travis-ci.org/CORE-GATECH-GROUP/serpent-tools.svg?branch=develop
-    :target: https://travis-ci.org/CORE-GATECH-GROUP/serpent-tools
-    :alt: Build status - develop
-
 .. image:: https://readthedocs.org/projects/serpent-tools/badge/?version=latest
     :target: http://serpent-tools.readthedocs.io/en/latest/?badge=latest
     :alt: Documentation Status
@@ -31,7 +27,7 @@ Installation
 
 ``serpentTools`` can be installed with ``pip`` using::
 
-   $ python -m pip install --user --upgrade pip serpentTools
+   $ pip install serpentTools
 
 For more detailed instructions, including operating-system specific
 instructions and building from source, see
diff --git a/docs/install.rst b/docs/install.rst
index ccfbced1..651287b1 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -37,37 +37,18 @@ printing a very basic python command::
 Installing from pip
 ===================
 
-:term:`pip` is the easiest way to install the latest version of 
-``serpentTools``. First, ensure that you have :term:`numpy` installed, 
-as this is one of the required packages that is tricky to install. You can
-check by opening up a your preferred terminal and executing
+Installing with :term:`pip` will pull from the python package index and is
+the simplest way to install::
 
-.. code::
+    $ pip install serpentTools
 
-   $ python -c "import numpy"
+This will install the latest release from https://pypi.org/project/serpentTools/.
 
-If this fails, please consult :ref:`install-python-dist`.
+Some additional packages, like ``pandas``, are not needed for core functionality
+but do provide nice capabilities. These can be picked up through the "extras"
+dependency group with::
 
-Next, installation with pip can be completed with::
-
-   $ python -m pip install --user --upgrade pip serpentTools
-
-This installs the dependencies of the package, the latest ``serpentTools`` release,
-and upgrades your version of :term:`pip` along the way.
-When a new release is issued, run the command again to install the updated version.
-
-If you wish to install the development branch to get the latest updates as they
-happen, use the following command::
-
-   $ python -m pip install -e git+https://www.github.com/CORE-GATECH-GROUP/serpent-tools.git@develop#egg=serpentTools
-
-.. note::
-
-   Changes to the development branch may not always be back-compatible
-   and may cause non-ideal outcomes. Be sure to check the
-   :ref:`changelog` before/after updating from the develop branch
-
-See also `pip install from git <https://pip.pypa.io/en/stable/reference/pip_install/#git>`_
+    $ pip install "serpentTools[extras]"
 
 .. _install-release:
 
@@ -82,39 +63,29 @@ Installing from a Release
 
     $ cd path/to/release
 
-4. Install using our setup script::
-
-    $ python setup.py install
-
-5. Verify the install by running our test suite::
-
-    $ python setup.py test
+4. Install with :term:`pip`
 
+    $ pip install .
 
 .. _install-git:
 
 Installing via git
 ==================
 
-The newest features are available on the ``develop`` branch before getting
-pushed to the ``master`` branch. We try to give decent notice when features are
-going to change via warning messages and our :ref:`changelog`, but changes
-to the API and other functionality can occur across the develop branch.
-
 1. Clone the repository and checkout the branch of your choosing. The default
-   is ``develop``::
+   is ``main``::
 
         $ git clone https://github.com/CORE-GATECH-GROUP/serpent-tools.git
         $ cd serpent-tools
-        $ git checkout master
+        $ git checkout main
 
-2. Install using our `setup script <https://github.com/CORE-GATECH-GROUP/serpent-tools/blob/setup.py>`_::
+2. Install all utilities with using :term:`pip`
 
-    $ python setup.py install
+    $ pip install -e ".[extras,test]"
 
 3. Verify the install by running our test suite::
 
-    $ python setup.py test
+    $ pytest tests
 
 .. _install-python-dist:
 
diff --git a/examples/BranchToNodalDiffusion.ipynb b/examples/BranchToNodalDiffusion.ipynb
index 161ebfe3..98860786 100644
--- a/examples/BranchToNodalDiffusion.ipynb
+++ b/examples/BranchToNodalDiffusion.ipynb
@@ -887,9 +887,9 @@
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "serpent-tools",
+   "display_name": "Python 3 (ipykernel)",
    "language": "python",
-   "name": "serpent-tools"
+   "name": "python3"
   },
   "language_info": {
    "codemirror_mode": {
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 00000000..da43f43b
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,56 @@
+[build-system]
+requires = ["setuptools>=61.0"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "serpentTools"
+version = "0.9.5"
+maintainers = [
+    {name="Dan Kotlyar"},
+    {name="Drew Johnson"},
+]
+description = "A suite of parsers designed to make interacting with Serpent output files simple, scriptable, and flawless"
+readme = "README.rst"
+requires-python = ">=3.8,<3.10"
+classifiers = [
+    "Development Status :: 3 - Alpha",
+    "Intended Audience :: Education",
+    "Intended Audience :: Science/Research",
+    "License :: OSI Approved :: MIT License",
+    "Natural Language :: English",
+    "Programming Language :: Python",
+    "Programming Language :: Python :: 3.8",
+    "Programming Language :: Python :: 3.9",
+]
+license = {file = "LICENSE"}
+dependencies = [
+    "numpy>=1.16.0",
+    "matplotlib>=2.2.3,!=3.3.4",
+    "pyyaml>=5.1.1",
+]
+
+
+[project.urls]
+"Homepage" = "https://github.com/CORE-GATECH-GROUP/serpent-tools"
+"Bug Tracker" = "https://github.com/CORE-GATECH-GROUP/serpent-tools/issues"
+
+[project.optional-dependencies]
+extras = ["pandas>1", "scipy"]
+test = ["pytest>=6", "pytest-cov", "coverage"]
+ci = ["jupyter"]
+
+[tool.setuptools]
+include-package-data = true
+
+[tool.setuptools.package-data]
+serpentTools = ["variables.yaml"]
+"serpentTools.data" = ["*.m", "*.coe"]
+
+[tool.setuptools.packages.find]
+where = ["serpentTools"]
+
+[tool.pytest.ini_options]
+markers = [
+    "plot: tests involving plotting capabilities",
+]
+addopts = "-rs"
\ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index ca1625c4..00000000
--- a/requirements.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-numpy>=1.16.0
-matplotlib>=2.2.3,!=3.3.4
-pyyaml>=5.1.1
diff --git a/scripts/ci/install.sh b/scripts/ci/install.sh
deleted file mode 100755
index 7d33343e..00000000
--- a/scripts/ci/install.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# Install script that depends on $INSTALL variable
-# Options:
-# setup: install with setup.py
-# sdist: create a source distribution and install from that
-# bdist_wheel: create a wheel and install from that
-
-set -ev
-set -o pipefail
-
-# Run only for CI builds
-if [[ $CI != true ]]; then
-    echo Install script only meant to be run for CI testing
-    exit 1
-fi
-
-if [[ -z $ST_INSTALL ]]; then exit 1; fi
-
-case $ST_INSTALL in
-    'setup')
-        python setup.py install
-        ;;
-    'sdist')
-        python setup.py sdist
-        pip install dist/serpentTools-*.tar.gz
-        ;;
-    *)
-        echo No install option $ST_INSTALL
-        exit 1
-esac
diff --git a/setup.cfg b/setup.cfg
index 443f453b..06da8483 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,7 +16,3 @@ exclude =
 ignore = 
     E402
     W503
-
-[tools.pytest]
-markers =
-    plot: tests involving plotting capabilities
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 61c02a31..00000000
--- a/setup.py
+++ /dev/null
@@ -1,87 +0,0 @@
-from os.path import join
-from glob import glob
-try:
-    from setuptools import setup
-    HAS_SETUPTOOLS = True
-except ImportError:
-    import warnings
-    from distutils.core import setup
-    warnings.warn('Installing with distutils. Use of setuptools is preferred')
-    HAS_SETUPTOOLS = False
-
-
-DATA_EXTS = {'*.m', '*.coe'}
-
-
-def getDataFiles():
-    """Return all matlab files from ``serpentTools/data``"""
-
-    files = []
-    for ext in DATA_EXTS:
-        files.extend(glob(join('serpentTools', 'data', ext)))
-    return files
-
-
-with open('README.rst') as readme:
-    longDesc = readme.read()
-
-classifiers = [
-    'Development Status :: 3 - Alpha',
-    'Intended Audience :: Education',
-    'Intended Audience :: Science/Research',
-    'License :: OSI Approved :: MIT License',
-    'Natural Language :: English',
-    'Programming Language :: Python',
-    'Programming Language :: Python :: 3.5',
-    'Programming Language :: Python :: 3.6',
-    'Programming Language :: Python :: 3.7',
-    'Programming Language :: Python :: 3.8',
-    'Programming Language :: Python :: 3.9',
-]
-
-with open('./requirements.txt') as req:
-    installRequires = req.read()
-
-pythonRequires = ">=3.5"
-
-version = "0.9.5"
-
-setupArgs = {
-    'name': 'serpentTools',
-    'packages': ['serpentTools', 'serpentTools.parsers', 'serpentTools.utils',
-                 'serpentTools.data', 'serpentTools.io',
-                 'serpentTools.objects', 'serpentTools.samplers'],
-    'url': 'https://github.com/CORE-GATECH-GROUP/serpent-tools',
-    'description': ('A suite of parsers designed to make interacting with '
-                    'SERPENT output files simple, scriptable, and flawless'),
-    'long_description': longDesc,
-    'long_description_content_type': 'text/x-rst',
-    'maintainer': 'Andrew Johnson',
-    'maintainer_email': 'ajohnson400@gatech.edu',
-    'author': 'serpentTools developer team',
-    'classifiers': classifiers,
-    'keywords': 'SERPENT file parsers transport',
-    'license': 'MIT',
-    'version': version,
-    'package_data': {
-        'serpentTools.data': ['data/{}'.format(ext) for ext in DATA_EXTS],
-    },
-    'include_package_data': True,
-    'data_files': [
-        ('serpentTools', ['serpentTools/variables.yaml', ]),
-        ('serpentTools/data', getDataFiles()),
-    ],
-}
-if HAS_SETUPTOOLS:
-    setupArgs.update({
-        'python_requires': pythonRequires,
-        'install_requires': installRequires,
-    })
-
-setup(**setupArgs)
-
-if not HAS_SETUPTOOLS:
-    warnings.warn(
-        'The following packages are required to use serpentTools version '
-        '{}:\n{}\nPlease ensure they are installed prior to use'
-        .format(version, '\n'.join(installRequires)))


Test patch:
diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml
index 30a87a83..58f9f100 100644
--- a/.github/workflows/testing.yaml
+++ b/.github/workflows/testing.yaml
@@ -6,57 +6,47 @@ on:
   pull_request:
     branches:
       - develop
-      - master
+      - main
   push:
     branches:
       - develop
-      - master
+      - main
 
 jobs:
   main:
-    runs-on: ubuntu-18.04
+    runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: [3.6, 3.7, 3.8, 3.9]
-        installer: [setup,sdist]
+        python-version: [3.8, 3.9]
 
-    name: 'Python ${{ matrix.python-version }} installer=${{ matrix.installer }}'
-
-    # Environment variables
-    env:
-      ST_INSTALL: ${{ matrix.installer }}
+    name: 'Python ${{ matrix.python-version }}'
 
     steps:
       - 
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
 
       - 
         name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
 
       -
         name: install
         shell: bash
-        run: |
-          pip install -r requirements.txt
-          pip install -r requirements-test.txt
-          $GITHUB_WORKSPACE/scripts/ci/install.sh
+        run: pip install ".[extras,test,ci]"
 
       -
-        name: test
+        name: unit tests
         shell: bash
-        run: |
-          pytest --cov=serpentTools --cov-report= -v
-          $GITHUB_WORKSPACE/scripts/ci/testNotebooks.sh
+        run: pytest --cov=serpentTools --cov-report= -v
 
       -
         name: artifacts
-        uses: actions/upload-artifact@v2
+        uses: actions/upload-artifact@v3
         if: failure()  # only if the previous step failed
         with:
-            name: test-images-${{ matrix.python-version }}-${{ matrix.installer }}
+            name: test-images-${{ matrix.python-version }}
             path: |
                 tests/plots/result_images/*png
 
diff --git a/pytest.ini b/pytest.ini
deleted file mode 100644
index ce2dfbb5..00000000
--- a/pytest.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[pytest]
-filterwarnings=ignore::UserWarning
-addopts=-rs
diff --git a/requirements-test.txt b/requirements-test.txt
deleted file mode 100644
index af0626ad..00000000
--- a/requirements-test.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-ipython>=5.8.0,<=7.0.0
-flake8==3.5.0
-pandas>=1,<=1.3
-jupyter==1.0.0
-coverage==4.5.1
-scipy==1.3.2
-pytest<6.0.0
-pytest-cov==2.7.1
diff --git a/scripts/ci/testNotebooks.sh b/scripts/ci/testNotebooks.sh
deleted file mode 100755
index eb2d3979..00000000
--- a/scripts/ci/testNotebooks.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-
-# Script to convert jupyter notebooks to python and execute
-# Issue 69
-
-# Must be run from the main directory of the project
-
-set -e
-
-if [ ! -d examples ]; then
-	echo 'Examples directory does not exist'
-	exit 1
-fi
-
-echo "jupyter version: $(jupyter --version)"
-echo "nbconvert version: $(jupyter nbconvert --version)"
-
-# Make a temporary directory
-# Copy over python files
-
-tmp_dir=$(mktemp -d)
-orig_dir=$(pwd)
-
-# Remove temp dir on exit
-trap "rm -rf $tmp_dir && cd $orig_dir && echo Temporary directory $tmp_dir removed" EXIT
-
-cp examples/*py $tmp_dir
-cp examples/myConfig.yaml $tmp_dir
-
-jupyter nbconvert --to python --output-dir=$tmp_dir examples/*.ipynb
-
-cd $tmp_dir 
-
-for pyFile in *.py; do
-	# comment out the get_ipython functions
-	sed -i 's/get_ipython/#get_ipython/' $pyFile
-	outFile=out_$pyFile
-	python $pyFile > $outFile
-	if [ $? == 0 ]; then
-		echo Script $pyFile passed
-	else
-		echo Script $pyFile failed
-        cat $outFile
-		exit 1
-	fi
-done