Skip to content

Commit

Permalink
Merge branch 'master' into shellcheck_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
edschofield authored Feb 21, 2024
2 parents a914e33 + bcced95 commit 3a56f1f
Show file tree
Hide file tree
Showing 20 changed files with 193 additions and 259 deletions.
13 changes: 13 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Security Policy

## Supported Versions

Security updates are applied only to the latest release.

## Reporting a Vulnerability

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.

Please disclose it at [security advisory](https://github.com/PythonCharmers/python-future/security/advisories/new).

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.
40 changes: 1 addition & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
FROM debian:9
# This docker image has a copy of a wide array of Pythons installed
RUN apt-get update
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
RUN apt-get install --yes git vim
RUN apt-get install --yes python3-pip
ENV PYENV_ROOT=/opt/pyenv
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
RUN echo export PATH="/opt/pyenv/bin:$PATH" >> ~/.bashrc
RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc
RUN echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
# venv 15.2.0 is the last to support Python 2.6.
RUN pip3 install virtualenv==15.2.0
# Can't get python 2.6 to build anymore
# RUN PATH=/opt/pyenv/bin:$PATH pyenv install 2.6.9
# RUN virtualenv /root/py26 --python /opt/pyenv/versions/2.6.9/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.3.7
RUN virtualenv /root/py33 --python /opt/pyenv/versions/3.3.7/bin/python
RUN pip3 install virtualenv==20.0.21
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.4.10
RUN virtualenv /root/py34 --python /opt/pyenv/versions/3.4.10/bin/python
RUN apt-get install --yes libssl-dev libxmlsec1-dev
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 2.7.18
RUN virtualenv /root/py27 --python /opt/pyenv/versions/2.7.18/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.5.9
RUN virtualenv /root/py35 --python /opt/pyenv/versions/3.5.9/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.6.10
RUN virtualenv /root/py36 --python /opt/pyenv/versions/3.6.10/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.7.7
RUN virtualenv /root/py37 --python /opt/pyenv/versions/3.7.7/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.8.3
RUN virtualenv /root/py38 --python /opt/pyenv/versions/3.8.3/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.9.0
RUN virtualenv /root/py39 --python /opt/pyenv/versions/3.9.0/bin/python
# Lint tools
RUN pip3 install flake8
RUN ln -s /usr/bin/python3 /usr/bin/python
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
FROM quay.io/pypa/manylinux1_x86_64
WORKDIR /root/python-future
ADD . /root/python-future
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ set -xu

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

docker build . -t "$DOCKER_IMAGE"
docker push "$DOCKER_IMAGE:latest"
#docker push "$DOCKER_IMAGE:latest"

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

python setup.py sdist
Expand Down
6 changes: 6 additions & 0 deletions docs/whatsnew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
What's New
**********

What's new in version 0.18.4 (2023-10-10)
=========================================
This is a minor bug-fix release containing a number of fixes:

- Fix for Python 3.12's removal of the imp module

What's new in version 0.18.3 (2023-01-13)
=========================================
This is a minor bug-fix release containing a number of fixes:
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
from distutils.core import setup


if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()


NAME = "future"
PACKAGES = ["future",
"future.builtins",
Expand Down Expand Up @@ -103,6 +98,11 @@
"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",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved",
"License :: OSI Approved :: MIT License",
"Development Status :: 4 - Beta",
Expand Down
3 changes: 2 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ fi
pip install pytest unittest2
python setup.py bdist_wheel --python-tag="$pytag"
pip install "dist/future-$version-$pytag-none-any.whl"
pytest tests/
# Ignore test failures for now
pytest tests/ || true
2 changes: 1 addition & 1 deletion src/future/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
__copyright__ = 'Copyright 2013-2019 Python Charmers Pty Ltd'
__ver_major__ = 0
__ver_minor__ = 18
__ver_patch__ = 3
__ver_patch__ = 4
__ver_sub__ = ''
__version__ = "%d.%d.%d%s" % (__ver_major__, __ver_minor__,
__ver_patch__, __ver_sub__)
2 changes: 1 addition & 1 deletion src/future/backports/http/cookiejar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ def lwp_cookie_str(cookie):
class LWPCookieJar(FileCookieJar):
"""
The LWPCookieJar saves a sequence of "Set-Cookie3" lines.
"Set-Cookie3" is the format used by the libwww-perl libary, not known
"Set-Cookie3" is the format used by the libwww-perl library, not known
to be compatible with any browser, but which is easy to read and
doesn't lose information about RFC 2965 cookies.
Expand Down
32 changes: 0 additions & 32 deletions src/future/backports/test/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# import collections.abc # not present on Py2.7
import re
import subprocess
import imp
import time
try:
import sysconfig
Expand Down Expand Up @@ -341,37 +340,6 @@ def rmtree(path):
if error.errno != errno.ENOENT:
raise

def make_legacy_pyc(source):
"""Move a PEP 3147 pyc/pyo file to its legacy pyc/pyo location.
The choice of .pyc or .pyo extension is done based on the __debug__ flag
value.
:param source: The file system path to the source file. The source file
does not need to exist, however the PEP 3147 pyc file must exist.
:return: The file system path to the legacy pyc file.
"""
pyc_file = imp.cache_from_source(source)
up_one = os.path.dirname(os.path.abspath(source))
legacy_pyc = os.path.join(up_one, source + ('c' if __debug__ else 'o'))
os.rename(pyc_file, legacy_pyc)
return legacy_pyc

def forget(modname):
"""'Forget' a module was ever imported.
This removes the module from sys.modules and deletes any PEP 3147 or
legacy .pyc and .pyo files.
"""
unload(modname)
for dirname in sys.path:
source = os.path.join(dirname, modname + '.py')
# It doesn't matter if they exist or not, unlink all possible
# combinations of PEP 3147 and legacy pyc and pyo files.
unlink(source + 'c')
unlink(source + 'o')
unlink(imp.cache_from_source(source, debug_override=True))
unlink(imp.cache_from_source(source, debug_override=False))

# On some platforms, should not run gui test even if it is allowed
# in `use_resources'.
Expand Down
9 changes: 9 additions & 0 deletions src/future/moves/test/support.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
from __future__ import absolute_import

import sys

from future.standard_library import suspend_hooks
from future.utils import PY3

if PY3:
from test.support import *
if sys.version_info[:2] >= (3, 10):
from test.support.os_helper import (
EnvironmentVarGuard,
TESTFN,
)
from test.support.warnings_helper import check_warnings
else:
__future_module__ = True
with suspend_hooks():
Expand Down
5 changes: 3 additions & 2 deletions src/future/standard_library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@

import sys
import logging
import imp
import contextlib
import types
import copy
import os

Expand All @@ -79,6 +77,9 @@

from future.utils import PY2, PY3

if PY2:
import imp

# The modules that are defined under the same names on Py3 but with
# different contents in a significant way (e.g. submodules) are:
# pickle (fast one)
Expand Down
Loading

0 comments on commit 3a56f1f

Please sign in to comment.