Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise python version from 3.8+ to 3.9+ #1581

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
- name: Lint with flake8
run: |
pip install flake8
Expand All @@ -39,14 +39,17 @@ jobs:
matrix:
include:
- os: macos-latest
python-version: '3.8'
toxenv: py38-fuse2
python-version: '3.9'
toxenv: py39-fuse2
- os: windows-latest
python-version: '3.11'
toxenv: py38-fuse2
toxenv: py311-fuse3
- os: ubuntu-latest
python-version: '3.10'
toxenv: py39-fuse3
toxenv: py310-fuse3
- os: ubuntu-latest
python-version: '3.12'
toxenv: py312-fuse3

runs-on: ${{ matrix.os }}
timeout-minutes: 60
Expand Down
4 changes: 2 additions & 2 deletions docs/admin/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ Before you can run moin, you need to install it.

Using your standard user account, run the following command
from the project root directory. Replace <python> in the command
below with the path to a python 3.8+ executable. This is usually
just "python", but may be "python3", "python3.8", "/opt/pypy/bin/pypy"
below with the path to a python 3.9+ executable. This is usually
just "python", but may be "python3", "python3.9", "/opt/pypy/bin/pypy"
or even <some-other-path-to-python>:

::
Expand Down
6 changes: 3 additions & 3 deletions docs/admin/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
Requirements
============

MoinMoin requires Python 3.8+. A CPython distribution is
MoinMoin requires Python 3.9+. A CPython distribution is
recommended because it will likely be the fastest and most stable.
Most developers use a CPython distribution for testing.
Typical linux distributions will either have Python 3.8+ installed by
default or will have a package manager that will install Python 3.8+
Typical linux distributions will either have Python 3.9+ installed by
default or will have a package manager that will install Python 3.9+
as a secondary Python.
Windows users may download CPython distributions from https://www.python.org/ or
https://www.activestate.com/.
Expand Down
30 changes: 7 additions & 23 deletions quickinstall.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/python3
# Copyright: 2013 MoinMoin:BastianBlank
# Copyright: 2013-2018 MoinMoin:RogerHaase
# Copyright: 2023 MoinMoin:UlrichB
# Copyright: 2023-2024 MoinMoin:UlrichB
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
"""
Create a virtual environment and install moin2 and all requirements in development mode.

Usage for installation:

<python> quickinstall.py (where <python> is any Python 3.8+ executable)
<python> quickinstall.py (where <python> is any Python 3.9+ executable)

Requires: Python 3.8+, pip
Requires: Python 3.9+, pip

The first run of quickinstall.py creates these files or symlink in the repo root:

Expand Down Expand Up @@ -47,8 +47,8 @@
import venv


if sys.hexversion < 0x3080000:
sys.exit("Error: MoinMoin requires Python 3.8+, current version is %s\n" % (platform.python_version(), ))
if sys.hexversion < 0x3090000:
sys.exit("Error: MoinMoin requires Python 3.9+, current version is %s\n" % (platform.python_version(), ))


WIN_INFO = 'm.bat, activate.bat, and deactivate.bat are created by quickinstall.py'
Expand Down Expand Up @@ -272,8 +272,6 @@ def cmd_quickinstall(self, *args):
with open(QUICKINSTALL, 'w') as messages:
# we run ourself as a subprocess so output can be captured in a log file
subprocess.run(command, shell=True, stderr=messages, stdout=messages)
# above result will be flagged as error unless all python versions specified in tox.ini are installed:
# [tox]\n envlist = py{38,39,310},pypy3,flake8
print('\nSearching {0}, important messages are shown below... Do "{1} log quickinstall" '
'to see complete log.\n'.format(QUICKINSTALL, M))
search_for_phrase(QUICKINSTALL)
Expand Down Expand Up @@ -562,34 +560,20 @@ def __call__(self):
self.do_helpers()
self.do_install()
self.do_catalog()
sys.stdout.write("\n\nSuccessfully created or updated venv at {0}".format(self.dir_venv))
sys.stdout.write("\n\nSuccessfully created or updated venv at {0}\n".format(self.dir_venv))

def do_venv(self):
venv.create(self.dir_venv, system_site_packages=False, clear=False, symlinks=False, with_pip=True, prompt=None)

def get_pip_version(self):
"""Return pip version as a list: [1, 5, 1]"""
command = 'pip --version'
pip_txt = subprocess.check_output(command, shell=True)
# expecting pip_txt similar to "pip 1.4.1 from /bitbucket/moin-2.0..."
pip_txt = pip_txt.decode().split()
if pip_txt[0] == 'pip':
pip_version = [int(x) for x in pip_txt[1].split('.')]
return pip_version
else:
sys.exit("Error: 'pip --version' produced unexpected results: '{0}".format(' '.join(pip_txt)))

def do_install(self):
pip_version = self.get_pip_version()
args = [
os.path.join(self.dir_venv_bin, 'pip'),
'install',
'--upgrade',
'--upgrade-strategy=eager',
'--editable',
self.dir_source,
]
if pip_version >= [9, 0]:
args += ['--upgrade-strategy=eager', ]
subprocess.check_call(args)

def do_catalog(self):
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# Copyright: 2001 by Juergen Hermann <[email protected]>
# Copyright: 2001-2018 MoinMoin:ThomasWaldmann
# Copyright: 2023 MoinMoin project
# Copyright: 2023-2024 MoinMoin:UlrichB
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

import os
Expand Down Expand Up @@ -39,9 +39,10 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP :: WSGI",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
Expand Down
5 changes: 3 additions & 2 deletions src/moin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright: 2000-2006 by Juergen Hermann <[email protected]>
# Copyright: 2002-2018 MoinMoin:ThomasWaldmann
# Copyright: 2024 MoinMoin:UlrichB
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
Expand All @@ -15,5 +16,5 @@
project = "MoinMoin"


if sys.hexversion < 0x3080000:
sys.exit("Error: %s requires Python 3.8+, current version is %s\n" % (project, platform.python_version()))
if sys.hexversion < 0x3090000:
sys.exit("Error: %s requires Python 3.9+, current version is %s\n" % (project, platform.python_version()))
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# tox -- -v

[tox]
envlist = py{38,39,310},pypy3,flake8
envlist = py{39,310,311,312},flake8

[testenv]
deps = -rrequirements.d/development.txt
Expand Down