Skip to content

Commit 3a56f1f

Browse files
authored
Merge branch 'master' into shellcheck_fixes
2 parents a914e33 + bcced95 commit 3a56f1f

20 files changed

+193
-259
lines changed

Diff for: .github/SECURITY.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Security updates are applied only to the latest release.
6+
7+
## Reporting a Vulnerability
8+
9+
If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released.
10+
11+
Please disclose it at [security advisory](https://github.com/PythonCharmers/python-future/security/advisories/new).
12+
13+
This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.

Diff for: Dockerfile

+1-39
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,3 @@
1-
FROM debian:9
2-
# This docker image has a copy of a wide array of Pythons installed
3-
RUN apt-get update
4-
RUN apt-get install --yes --no-install-recommends make build-essential zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libffi-dev liblzma-dev libssl1.0-dev
5-
RUN apt-get install --yes git vim
6-
RUN apt-get install --yes python3-pip
7-
ENV PYENV_ROOT=/opt/pyenv
8-
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
9-
RUN echo export PATH="/opt/pyenv/bin:$PATH" >> ~/.bashrc
10-
RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc
11-
RUN echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
12-
# venv 15.2.0 is the last to support Python 2.6.
13-
RUN pip3 install virtualenv==15.2.0
14-
# Can't get python 2.6 to build anymore
15-
# RUN PATH=/opt/pyenv/bin:$PATH pyenv install 2.6.9
16-
# RUN virtualenv /root/py26 --python /opt/pyenv/versions/2.6.9/bin/python
17-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.3.7
18-
RUN virtualenv /root/py33 --python /opt/pyenv/versions/3.3.7/bin/python
19-
RUN pip3 install virtualenv==20.0.21
20-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.4.10
21-
RUN virtualenv /root/py34 --python /opt/pyenv/versions/3.4.10/bin/python
22-
RUN apt-get install --yes libssl-dev libxmlsec1-dev
23-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 2.7.18
24-
RUN virtualenv /root/py27 --python /opt/pyenv/versions/2.7.18/bin/python
25-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.5.9
26-
RUN virtualenv /root/py35 --python /opt/pyenv/versions/3.5.9/bin/python
27-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.6.10
28-
RUN virtualenv /root/py36 --python /opt/pyenv/versions/3.6.10/bin/python
29-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.7.7
30-
RUN virtualenv /root/py37 --python /opt/pyenv/versions/3.7.7/bin/python
31-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.8.3
32-
RUN virtualenv /root/py38 --python /opt/pyenv/versions/3.8.3/bin/python
33-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.9.0
34-
RUN virtualenv /root/py39 --python /opt/pyenv/versions/3.9.0/bin/python
35-
# Lint tools
36-
RUN pip3 install flake8
37-
RUN ln -s /usr/bin/python3 /usr/bin/python
38-
ENV LC_ALL=C.UTF-8
39-
ENV LANG=C.UTF-8
1+
FROM quay.io/pypa/manylinux1_x86_64
402
WORKDIR /root/python-future
413
ADD . /root/python-future

Diff for: build.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ set -xu
44

55
DOCKER_IMAGE=jmadler/python-future-builder
66
# XXX: TODO: Perhaps this version shouldn't be hardcoded
7-
version=0.18.3
7+
version=0.18.4
88

99
docker build . -t "$DOCKER_IMAGE"
10-
docker push "$DOCKER_IMAGE:latest"
10+
#docker push "$DOCKER_IMAGE:latest"
1111

12-
for i in py26 py27 py33 py34 py35 py36 py37 py38 py39; do
13-
docker run -ti -v "$(realpath dist)":/root/python-future/dist "$DOCKER_IMAGE" /root/python-future/setup.sh "$version" "$i"
12+
for i in cp27-cp27m cp35-cp35m cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39; do
13+
docker run -ti -v "$(realpath dist)":/root/python-future/dist "$DOCKER_IMAGE" /root/python-future/setup.sh "$version" $(basename $i)
1414
done
1515

1616
python setup.py sdist

Diff for: docs/whatsnew.rst

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
What's New
44
**********
55

6+
What's new in version 0.18.4 (2023-10-10)
7+
=========================================
8+
This is a minor bug-fix release containing a number of fixes:
9+
10+
- Fix for Python 3.12's removal of the imp module
11+
612
What's new in version 0.18.3 (2023-01-13)
713
=========================================
814
This is a minor bug-fix release containing a number of fixes:

Diff for: setup.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
from distutils.core import setup
1414

1515

16-
if sys.argv[-1] == 'publish':
17-
os.system('python setup.py sdist upload')
18-
sys.exit()
19-
20-
2116
NAME = "future"
2217
PACKAGES = ["future",
2318
"future.builtins",
@@ -103,6 +98,11 @@
10398
"Programming Language :: Python :: 3.5",
10499
"Programming Language :: Python :: 3.6",
105100
"Programming Language :: Python :: 3.7",
101+
"Programming Language :: Python :: 3.8",
102+
"Programming Language :: Python :: 3.9",
103+
"Programming Language :: Python :: 3.10",
104+
"Programming Language :: Python :: 3.11",
105+
"Programming Language :: Python :: 3.12",
106106
"License :: OSI Approved",
107107
"License :: OSI Approved :: MIT License",
108108
"Development Status :: 4 - Beta",

Diff for: setup.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ fi
1717
pip install pytest unittest2
1818
python setup.py bdist_wheel --python-tag="$pytag"
1919
pip install "dist/future-$version-$pytag-none-any.whl"
20-
pytest tests/
20+
# Ignore test failures for now
21+
pytest tests/ || true

Diff for: src/future/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
__copyright__ = 'Copyright 2013-2019 Python Charmers Pty Ltd'
8888
__ver_major__ = 0
8989
__ver_minor__ = 18
90-
__ver_patch__ = 3
90+
__ver_patch__ = 4
9191
__ver_sub__ = ''
9292
__version__ = "%d.%d.%d%s" % (__ver_major__, __ver_minor__,
9393
__ver_patch__, __ver_sub__)

Diff for: src/future/backports/http/cookiejar.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,7 @@ def lwp_cookie_str(cookie):
18511851
class LWPCookieJar(FileCookieJar):
18521852
"""
18531853
The LWPCookieJar saves a sequence of "Set-Cookie3" lines.
1854-
"Set-Cookie3" is the format used by the libwww-perl libary, not known
1854+
"Set-Cookie3" is the format used by the libwww-perl library, not known
18551855
to be compatible with any browser, but which is easy to read and
18561856
doesn't lose information about RFC 2965 cookies.
18571857

Diff for: src/future/backports/test/support.py

-32
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
# import collections.abc # not present on Py2.7
2929
import re
3030
import subprocess
31-
import imp
3231
import time
3332
try:
3433
import sysconfig
@@ -341,37 +340,6 @@ def rmtree(path):
341340
if error.errno != errno.ENOENT:
342341
raise
343342

344-
def make_legacy_pyc(source):
345-
"""Move a PEP 3147 pyc/pyo file to its legacy pyc/pyo location.
346-
347-
The choice of .pyc or .pyo extension is done based on the __debug__ flag
348-
value.
349-
350-
:param source: The file system path to the source file. The source file
351-
does not need to exist, however the PEP 3147 pyc file must exist.
352-
:return: The file system path to the legacy pyc file.
353-
"""
354-
pyc_file = imp.cache_from_source(source)
355-
up_one = os.path.dirname(os.path.abspath(source))
356-
legacy_pyc = os.path.join(up_one, source + ('c' if __debug__ else 'o'))
357-
os.rename(pyc_file, legacy_pyc)
358-
return legacy_pyc
359-
360-
def forget(modname):
361-
"""'Forget' a module was ever imported.
362-
363-
This removes the module from sys.modules and deletes any PEP 3147 or
364-
legacy .pyc and .pyo files.
365-
"""
366-
unload(modname)
367-
for dirname in sys.path:
368-
source = os.path.join(dirname, modname + '.py')
369-
# It doesn't matter if they exist or not, unlink all possible
370-
# combinations of PEP 3147 and legacy pyc and pyo files.
371-
unlink(source + 'c')
372-
unlink(source + 'o')
373-
unlink(imp.cache_from_source(source, debug_override=True))
374-
unlink(imp.cache_from_source(source, debug_override=False))
375343

376344
# On some platforms, should not run gui test even if it is allowed
377345
# in `use_resources'.

Diff for: src/future/moves/test/support.py

+9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
from __future__ import absolute_import
2+
3+
import sys
4+
25
from future.standard_library import suspend_hooks
36
from future.utils import PY3
47

58
if PY3:
69
from test.support import *
10+
if sys.version_info[:2] >= (3, 10):
11+
from test.support.os_helper import (
12+
EnvironmentVarGuard,
13+
TESTFN,
14+
)
15+
from test.support.warnings_helper import check_warnings
716
else:
817
__future_module__ = True
918
with suspend_hooks():

Diff for: src/future/standard_library/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@
6262

6363
import sys
6464
import logging
65-
import imp
6665
import contextlib
67-
import types
6866
import copy
6967
import os
7068

@@ -79,6 +77,9 @@
7977

8078
from future.utils import PY2, PY3
8179

80+
if PY2:
81+
import imp
82+
8283
# The modules that are defined under the same names on Py3 but with
8384
# different contents in a significant way (e.g. submodules) are:
8485
# pickle (fast one)

0 commit comments

Comments
 (0)