From 04a463474b3ffb011152707d94cb9f8e6626bff6 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sat, 2 Dec 2023 14:03:29 +0100 Subject: [PATCH 1/3] Bump minimal supported Python version to 3.9+ --- .circleci/config.yml | 54 ++++++++++++++++---------------------------- .gitignore | 4 ++++ README.rst | 2 +- setup.py | 9 ++++---- tox.ini | 4 ++-- 5 files changed, 30 insertions(+), 43 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b970031..930f61d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,47 +9,33 @@ references: jobs: - test-3.5: + test-3.9: docker: - - image: circleci/python:3.5 + - image: circleci/python:3.9 steps: *test-steps environment: - TOXENV: py35 + TOXENV: py39 - test-3.6: + test-3.10: docker: - - image: circleci/python:3.6 + - image: circleci/python:3.10 steps: *test-steps environment: - TOXENV: py36 + TOXENV: py310 - test-3.7: + test-3.11: docker: - - image: circleci/python:3.7 + - image: circleci/python:3.11 steps: *test-steps environment: - TOXENV: py37 + TOXENV: py311 - test-3.8: + test-pypy3.11: docker: - - image: circleci/python:3.8.0b4 + - image: pypy:3.11 steps: *test-steps environment: - TOXENV: py38 - - test-pypy3.5: - docker: - - image: pypy:3.5 - steps: *test-steps - environment: - TOXENV: pypy35 - - test-pypy3.6: - docker: - - image: pypy:3.6 - steps: *test-steps - environment: - TOXENV: pypy36 + TOXENV: pypy311 workflows: version: 2 @@ -57,12 +43,10 @@ workflows: # Build on push on_push: jobs: - - test-3.5 - - test-3.6 - - test-3.7 - - test-3.8 - - test-pypy3.5 - - test-pypy3.6 + - test-3.9 + - test-3.10 + - test-3.11 + - test-pypy3.11 # Build master every week on Monday at 04:00 am weekly: @@ -74,6 +58,6 @@ workflows: only: - master jobs: - - test-3.5 - - test-3.6 - - test-3.7 + - test-3.9 + - test-3.10 + - test-3.11 diff --git a/.gitignore b/.gitignore index bdb4573..59085c2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ .coverage .coveralls.yml .tox +venv/ +VENV/ +virtual/ +VIRTUAL/ diff --git a/README.rst b/README.rst index 876241d..475653b 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,7 @@ readable argument parsing. Relies on the public transport API by opendata.ch: http://transport.opendata.ch/ -Fahrplan supports Python 3.5+. +Fahrplan supports Python 3.9+. Installing diff --git a/setup.py b/setup.py index 18bf84c..8961b31 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,10 @@ f = open('requirements.txt', 'r') lines = f.readlines() -requirements = [l.strip().strip('\n') for l in lines if l.strip() and not l.strip().startswith('#')] +requirements = [ + line.strip().strip('\n') for line in lines + if line.strip() and not line.strip().startswith('#') +] readme = open('README.rst').read() setup(name='fahrplan', @@ -38,10 +41,6 @@ 'Operating System :: MacOS', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', 'Topic :: Internet', 'Topic :: Terminals', ], diff --git a/tox.ini b/tox.ini index 96dee79..05fccc5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py35, py36, py37 +envlist = py39, py310, py311 [testenv] deps = @@ -8,7 +8,7 @@ deps = commands = nose2 fahrplan [testenv:cov] -basepython=python3.5 +basepython=python3.11 deps= {[testenv]deps} cov-core From bba65aad6122d47450cc68cc7869c7ed5503ef52 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sat, 2 Dec 2023 14:09:17 +0100 Subject: [PATCH 2/3] Switch to Github CI --- .circleci/config.yml | 63 ---------------------------------------- .github/workflows/ci.yml | 22 ++++++++++++++ README.rst | 6 ++-- 3 files changed, 25 insertions(+), 66 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 930f61d..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,63 +0,0 @@ -version: 2 - -references: - - test-steps: &test-steps - - checkout - - run: pip install --user tox - - run: ~/.local/bin/tox - -jobs: - - test-3.9: - docker: - - image: circleci/python:3.9 - steps: *test-steps - environment: - TOXENV: py39 - - test-3.10: - docker: - - image: circleci/python:3.10 - steps: *test-steps - environment: - TOXENV: py310 - - test-3.11: - docker: - - image: circleci/python:3.11 - steps: *test-steps - environment: - TOXENV: py311 - - test-pypy3.11: - docker: - - image: pypy:3.11 - steps: *test-steps - environment: - TOXENV: pypy311 - -workflows: - version: 2 - - # Build on push - on_push: - jobs: - - test-3.9 - - test-3.10 - - test-3.11 - - test-pypy3.11 - - # Build master every week on Monday at 04:00 am - weekly: - triggers: - - schedule: - cron: "0 4 * * 1" - filters: - branches: - only: - - master - jobs: - - test-3.9 - - test-3.10 - - test-3.11 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..277b70e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI +on: [push] +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + pyversion: ["3.9", "3.10", "3.11"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "${{ matrix.version }}" + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install tox + run: pip install tox + - name: Run tests on Python ${{ matrix.version }} + run: tox + env: + TOXENV: "py${{ matrix.version }}" diff --git a/README.rst b/README.rst index 475653b..9b41105 100644 --- a/README.rst +++ b/README.rst @@ -2,11 +2,11 @@ fahrplan ======== -.. image:: https://circleci.com/gh/dbrgn/fahrplan.svg?style=shield&circle-token=:circle-token +.. image:: https://github.com/dbrgn/fahrplan/actions/workflows/CI/badge.svg :alt: Build status - :target: https://circleci.com/gh/dbrgn/fahrplan/ + :target: https://github.com/dbrgn/fahrplan/actions -Goal: Simple access to the SBB/CFF/FFS timetable service from the commandline with human +Goal: Simple access to the SBB/CFF/FFS timetable service from the command line with human readable argument parsing. Relies on the public transport API by opendata.ch: http://transport.opendata.ch/ From d2aa660269278b3544c8e1462a49fea866090d3e Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sat, 2 Dec 2023 14:17:21 +0100 Subject: [PATCH 3/3] Fix failing test --- fahrplan/tests/test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/fahrplan/tests/test.py b/fahrplan/tests/test.py index c485bd9..90b0663 100644 --- a/fahrplan/tests/test.py +++ b/fahrplan/tests/test.py @@ -53,7 +53,6 @@ def testHelp(self): r = run_command('{0} {1}'.format(BASE_COMMAND, arg)) self.assertTrue(meta.description in r.std_out) self.assertTrue('usage:' in r.std_out) - self.assertTrue('optional arguments:' in r.std_out) self.assertTrue('positional arguments:' in r.std_out) self.assertTrue('Examples:' in r.std_out)