From dab11b431c8786434c2e25aed06191a0a4eac137 Mon Sep 17 00:00:00 2001 From: Justin Vasel Date: Thu, 8 Feb 2024 17:07:23 -0500 Subject: [PATCH 1/2] Upgrade and clean up dependencies - Drop support for python versions less than 3.11 - Drop several dependencies that don't appear to be used - Upgrade all packages that can be upgraded. --- .readthedocs.yaml | 2 +- requirements.txt | 32 ++++++++------------------------ setup.py | 28 ++++++++++++++-------------- 3 files changed, 23 insertions(+), 39 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 7d710eb..812167d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -4,7 +4,7 @@ version: 2 build: os: "ubuntu-20.04" tools: - python: "3.9" + python: "3.11" sphinx: configuration: docs/conf.py diff --git a/requirements.txt b/requirements.txt index 41ad4a3..e0f62f5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,24 +1,8 @@ -click>=8.1.2 -fixtures==3.0.0 -ipython~=7.32.0 -mock==4.0.3 -nose==1.3.7 -python-dotenv==0.19.2 -setuptools>=62.1.0 -six==1.14.0 -testrepository==0.0.20 -testresources==2.0.1 -testscenarios==0.5.0 -testtools==2.5.0 -virtualenv==20.13.0 -wheel==0.34.2 -inquirer>=2.8.0 -hop-client==0.8.0 -attrs>=21.4.0 -docutils==0.17.1 -myst-parser==0.16.1 -sphinx_rtd_theme==1.0.0 -sphinx-autoapi==1.8.4 -sphinxcontrib-programoutput==0.17 -pytest>=6.2.5 -numpy>=1.22.3 \ No newline at end of file +click~=8.1 +hop-client~=0.9 +inquirer~=2.8 +ipython~=8.7 +numpy~=1.26 +python-dotenv~=0.19 +setuptools~=69.0 +wheel~=0.42 diff --git a/setup.py b/setup.py index 1ca6ce2..9732b7d 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ import os import re + from setuptools import find_packages, setup # read in README @@ -21,21 +22,20 @@ extras_require = { 'dev': [ - 'autopep8', - 'flake8', - 'mongomock', - 'pytest >= 5.0, < 5.4', - 'pytest-console-scripts', - 'pytest-cov', - 'pytest-mongodb', - 'pytest-runner', - 'twine', - 'schedule', + 'pytest~=8.0', + 'pytest-console-scripts~=1.4', + 'pytest-cov~-4.1', + 'pytest-mongodb~=2.4', + 'pytest-runner~=6.0', + 'virtualenv~=20.13', ], 'docs': [ - 'sphinx', - 'sphinx_rtd_theme', - 'sphinxcontrib-programoutput' + 'autoapi~=2.0', + 'myst_parser~=2.0', + 'sphinx~=7.2', + 'sphinx-autoapi~=3.0', + 'sphinx-rtd-theme~=2.0', + 'sphinxcontrib-programoutput~=0.17', ], } @@ -60,7 +60,7 @@ ], }, - python_requires='>=3.7', + python_requires='~=3.11', install_requires=install_requires, extras_require=extras_require, From 8970709d050c83d908282a96107aac4f08ba1a6a Mon Sep 17 00:00:00 2001 From: Justin Vasel Date: Thu, 8 Feb 2024 18:26:18 -0500 Subject: [PATCH 2/2] Modify github testing workflow configs --- .github/workflows/mac11-py39.yml | 65 -------------- .../{mac10-py38.yml => mac12-py311-312.yml} | 16 ++-- .../{mac11-py310.yml => mac13-py311-312.yml} | 16 ++-- .../{mac11-py38.yml => mac14-py311-312.yml} | 17 ++-- .github/workflows/ubuntu20-py310.yml | 84 ------------------- .github/workflows/ubuntu20-py39.yml | 79 ----------------- ...untu20-py38.yml => ubuntu22-py311-312.yml} | 28 ++++--- 7 files changed, 40 insertions(+), 265 deletions(-) delete mode 100644 .github/workflows/mac11-py39.yml rename .github/workflows/{mac10-py38.yml => mac12-py311-312.yml} (90%) rename .github/workflows/{mac11-py310.yml => mac13-py311-312.yml} (90%) rename .github/workflows/{mac11-py38.yml => mac14-py311-312.yml} (90%) delete mode 100644 .github/workflows/ubuntu20-py310.yml delete mode 100644 .github/workflows/ubuntu20-py39.yml rename .github/workflows/{ubuntu20-py38.yml => ubuntu22-py311-312.yml} (78%) diff --git a/.github/workflows/mac11-py39.yml b/.github/workflows/mac11-py39.yml deleted file mode 100644 index bde1235..0000000 --- a/.github/workflows/mac11-py39.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Mac 11 Python 3.9 - -on: - push: - branches: [ smolsky/testing ] - -jobs: - build: - runs-on: macos-11 - strategy: - # Add a list of python versions we want to use for testing. - matrix: - python-version: ['3.9'] - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - pip install flake8 - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Install librdkafka - run: brew install librdkafka - # - name: Install hop-client - # run: conda install -c conda-forge hop-client - - - name: Install requirements - run: | - python -m pip install --upgrade pip - pip install wheel - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - - shell: bash - env: - USERNAME: ${{ secrets.username }} - PASSWORD: ${{ secrets.password }} - run: | - /usr/bin/expect << HOP - spawn hop auth add - expect "Username:" - send "$USERNAME\n" - expect "Password:" - send "$PASSWORD\n" - expect "Hostname (may be empty):" - send "kafka.scimma.org\n" - expect eof - HOP - hop auth locate - - - name: Install snews-pt - run: pip install . - - - name: Run pytest - run: | - pip install pytest - pytest diff --git a/.github/workflows/mac10-py38.yml b/.github/workflows/mac12-py311-312.yml similarity index 90% rename from .github/workflows/mac10-py38.yml rename to .github/workflows/mac12-py311-312.yml index 137c90b..ca410a3 100644 --- a/.github/workflows/mac10-py38.yml +++ b/.github/workflows/mac12-py311-312.yml @@ -1,4 +1,4 @@ -name: Mac 10 Python 3.8 +name: Mac 12 Python 3.11-12 on: push: @@ -6,20 +6,20 @@ on: jobs: build: - runs-on: macos-10.15 + runs-on: macos-12 strategy: # Add a list of python versions we want to use for testing. matrix: - python-version: ['3.8'] + python-version: ['3.11', '3.12'] steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -65,4 +65,4 @@ jobs: - name: Run pytest run: | pip install pytest - pytest \ No newline at end of file + pytest diff --git a/.github/workflows/mac11-py310.yml b/.github/workflows/mac13-py311-312.yml similarity index 90% rename from .github/workflows/mac11-py310.yml rename to .github/workflows/mac13-py311-312.yml index 5a62bcb..645948a 100644 --- a/.github/workflows/mac11-py310.yml +++ b/.github/workflows/mac13-py311-312.yml @@ -1,4 +1,4 @@ -name: Mac 11 Python 3.10 +name: Mac 13 Python 3.11-12 on: push: @@ -6,20 +6,20 @@ on: jobs: build: - runs-on: macos-11 + runs-on: macos-13 strategy: # Add a list of python versions we want to use for testing. matrix: - python-version: ['3.10'] + python-version: ['3.11', '3.12'] steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -65,4 +65,4 @@ jobs: - name: Run pytest run: | pip install pytest - pytest \ No newline at end of file + pytest diff --git a/.github/workflows/mac11-py38.yml b/.github/workflows/mac14-py311-312.yml similarity index 90% rename from .github/workflows/mac11-py38.yml rename to .github/workflows/mac14-py311-312.yml index 9639c77..853efee 100644 --- a/.github/workflows/mac11-py38.yml +++ b/.github/workflows/mac14-py311-312.yml @@ -1,4 +1,5 @@ -name: Mac 11 Python 3.8 +name: Mac 14 + Python 3.11-12 on: push: @@ -6,20 +7,20 @@ on: jobs: build: - runs-on: macos-11 + runs-on: macos-14 strategy: # Add a list of python versions we want to use for testing. matrix: - python-version: ['3.8'] + python-version: ['3.11', '3.12'] steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -65,4 +66,4 @@ jobs: - name: Run pytest run: | pip install pytest - pytest \ No newline at end of file + pytest diff --git a/.github/workflows/ubuntu20-py310.yml b/.github/workflows/ubuntu20-py310.yml deleted file mode 100644 index 2378644..0000000 --- a/.github/workflows/ubuntu20-py310.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Ubuntu 20.04 Python 3.10 - -on: - push: - branches: - - smolsky/testing - - main - - pull_request: - branches: - - main - -jobs: - # Copied from snewpy. ;) - build: - # The type of runner that the job will run on. - runs-on: ubuntu-latest - strategy: - # Add a list of python versions we want to use for testing. - matrix: - python-version: ['3.10'] - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Check python version - run: python --version - - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - pip install flake8 - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Install hop-client - run: | - wget https://files.pythonhosted.org/packages/de/a2/1f663c824b7e6ac139110005888cda7e1aea74e3bb8a57d774a00a1802f5/hop-client-0.5.0.tar.gz - tar -xzf hop-client-0.5.0.tar.gz - cd hop-client-0.5.0 - python setup.py install - cd /home/runner/work/SNEWS_Publishing_Tools/SNEWS_Publishing_Tools - - - name: Install requirements - run: | - python -m pip install --upgrade pip - pip install wheel - pip install python-dotenv click tabulate - - - shell: bash - env: - USERNAME: ${{ secrets.username }} - PASSWORD: ${{ secrets.password }} - run: | - sudo apt-get install -y expect - which expect - /usr/bin/expect << HOP - spawn hop auth add - expect "Username:" - send "$USERNAME\n" - expect "Password:" - send "$PASSWORD\n" - expect "Hostname (may be empty):" - send "kafka.scimma.org\n" - expect eof - HOP - hop auth locate - - - name: Install snews-pt - run: pip install . - - - name: Check version - run: snews_pt --version - - - name: Run pytest - run: | - pip install pytest - pytest snews_pt \ No newline at end of file diff --git a/.github/workflows/ubuntu20-py39.yml b/.github/workflows/ubuntu20-py39.yml deleted file mode 100644 index e66a6a5..0000000 --- a/.github/workflows/ubuntu20-py39.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: testing - -on: - push: - branches: - - '**' - - pull_request: - branches: - - main - -jobs: - # Copied from snewpy. ;) - build: - # The type of runner that the job will run on. - runs-on: ubuntu-latest - strategy: - # Add a list of python versions we want to use for testing. - matrix: - python-version: ['3.9'] - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Check python version - run: python --version - - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - pip install flake8 - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Install hop-client - run: | - pip install -U hop-client - - - name: Install requirements - run: | - python -m pip install --upgrade pip - pip install wheel - pip install python-dotenv click tabulate - - - name: Add hop authorization - shell: bash - env: - USERNAME: ${{ secrets.username }} - PASSWORD: ${{ secrets.password }} - run: | - sudo apt-get install -y expect - which expect - /usr/bin/expect << HOP - spawn hop auth add - expect "Username:" - send "$USERNAME\n" - expect "Password:" - send "$PASSWORD\n" - expect "Hostname (may be empty):" - send "kafka.scimma.org\n" - expect "Token endpoint (empty if not applicable):" - send "\n" - expect eof - HOP - hop auth locate - - - name: Install snews-pt - run: pip install . - - - name: Run pytest - run: | - pip install pytest - pytest snews_pt diff --git a/.github/workflows/ubuntu20-py38.yml b/.github/workflows/ubuntu22-py311-312.yml similarity index 78% rename from .github/workflows/ubuntu20-py38.yml rename to .github/workflows/ubuntu22-py311-312.yml index d0db378..9978598 100644 --- a/.github/workflows/ubuntu20-py38.yml +++ b/.github/workflows/ubuntu22-py311-312.yml @@ -1,11 +1,11 @@ -name: Ubuntu 20.04 Python 3.8 +name: Ubuntu 22.04 Python 3.11-12 on: push: - branches: + branches: - smolsky/testing - main - + pull_request: branches: - main @@ -18,16 +18,16 @@ jobs: strategy: # Add a list of python versions we want to use for testing. matrix: - python-version: ['3.8'] + python-version: ["3.11", "3.12"] steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - + - name: Check python version run: python --version @@ -41,10 +41,10 @@ jobs: - name: Install hop-client run: | - pwd - wget https://files.pythonhosted.org/packages/de/a2/1f663c824b7e6ac139110005888cda7e1aea74e3bb8a57d774a00a1802f5/hop-client-0.5.0.tar.gz - tar -xzf hop-client-0.5.0.tar.gz - cd hop-client-0.5.0 + pip install install setuptools wheel + wget https://files.pythonhosted.org/packages/64/d1/108cea042128c7ea7790e15e12e3e5ed595bfcf4b051c34fe1064924beba/hop-client-0.9.0.tar.gz + tar -xzf hop-client-0.9.0.tar.gz + cd hop-client-0.9.0 python setup.py install cd /home/runner/work/SNEWS_Publishing_Tools/SNEWS_Publishing_Tools @@ -69,6 +69,8 @@ jobs: send "$PASSWORD\n" expect "Hostname (may be empty):" send "kafka.scimma.org\n" + expect "Token endpoint (empty if not applicable):" + send "\n" expect eof HOP hop auth locate @@ -82,4 +84,4 @@ jobs: - name: Run pytest run: | pip install pytest - pytest snews_pt \ No newline at end of file + pytest snews_pt