Skip to content

Commit

Permalink
updated setup.py for Python 3.4 (revert of 91ec14b)
Browse files Browse the repository at this point in the history
  • Loading branch information
scopatz committed May 14, 2019
1 parent 400cbfd commit 002a317
Show file tree
Hide file tree
Showing 14 changed files with 284 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ environment:

matrix:
# https://www.appveyor.com/docs/installed-software#python
- PYTHON: "C:\\Python35"
- PYTHON: "C:\\Python35-x64"
- PYTHON: "C:\\Python34"
- PYTHON: "C:\\Python34-x64"
DISTUTILS_USE_SDK: "1"
- XONSH_TEST_ENV: "MSYS2"
MSYS2_PATH: "C:\\msys64"
Expand Down
46 changes: 46 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,51 @@
version: 2

jobs:
build_34:
machine: true
environment:
PYTHON: "3.4"
ENV_NAME: "py34-xonsh-test"
steps:
- checkout
- restore_cache:
keys:
- miniconda-v1-{{ checksum "ci/environment-3.4.yml" }}
- run:
name: install miniconda
command: |
if [ ! -d "/home/circleci/miniconda" ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda config --set always_yes yes --set changeps1 no
fi
sudo chown -R $USER.$USER $HOME
- run:
name: configure conda
command: |
export PATH="$HOME/miniconda/bin:$PATH"
if [ ! -d "/home/circleci/miniconda/envs/py34-xonsh-test" ]; then
conda update -q conda
conda env create -f ci/environment-${PYTHON}.yml --name=${ENV_NAME}
source activate ${ENV_NAME}
fi
conda env list
conda list ${ENV_NAME}
- save_cache:
key: miniconda-v1-{{ checksum "ci/environment-3.4.yml" }}
paths:
- "/home/circleci/miniconda"
- run:
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate ${ENV_NAME}
pip install . --no-deps
- run:
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate ${ENV_NAME}
xonsh run-tests.xsh --timeout=10
build_35:
machine: true
environment:
Expand Down Expand Up @@ -175,6 +220,7 @@ workflows:
version: 2
run_all_pythons:
jobs:
- build_34
- build_35
- build_36
- build_black
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ xonsh
:target: https://codecov.io/gh/xonsh/xonsh

xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt.
The language is a superset of Python 3.5+ with additional shell primitives.
The language is a superset of Python 3.4+ with additional shell primitives.
xonsh (pronounced *conch*) is meant for the daily use of experts and novices alike.

Please visit https://xon.sh for more information.
Expand Down
21 changes: 21 additions & 0 deletions ci/environment-3.4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: py34-xonsh-test
channels:
- conda-forge
- defaults
dependencies:
- python=3.4
- pygments
- prompt_toolkit
- pytest
- pytest-timeout
- numpy
- psutil
- matplotlib
- flake8
- coverage
- pyflakes
- pytest-cov
- codecov
# conda forge doesn't have the following for Python v3.4
- pip:
- pytest-flake8
2 changes: 1 addition & 1 deletion docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ the xonsh shell
</p>

Xonsh is a Python-powered, cross-platform, Unix-gazing shell language and
command prompt. The language is a superset of Python 3.5+ with additional
command prompt. The language is a superset of Python 3.4+ with additional
shell primitives that you are used to from Bash and IPython. It works on
all major systems including Linux, Mac OSX, and Windows. Xonsh is meant
for the daily use of experts and novices alike.
25 changes: 25 additions & 0 deletions news/py34-req.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Updated setup.py to require Python 3.4 using the `python_requires` keyword.
This rectifies issues with pip installing xonsh. Python 3.4 support will
be removed on the following release.

**Security:**

* <news item>
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def main():
"linux": ["distro"],
"proctitle": ["setproctitle"],
}
skw["python_requires"] = ">=3.5"
skw["python_requires"] = ">=3.4"
setup(**skw)


Expand Down
23 changes: 22 additions & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from xonsh.parser import Parser
from xonsh.parsers.base import eval_fstr_fields

from tools import VER_FULL, skip_if_lt_py36, nodes_equal
from tools import VER_FULL, skip_if_py34, skip_if_lt_py36, nodes_equal

# a lot of col_offset data changed from Py v3.5.0 -> v3.5.1
INC_ATTRS = (3, 5, 1) <= VER_FULL
Expand Down Expand Up @@ -186,6 +186,7 @@ def test_binop_times():
check_ast("42 * 65")


@skip_if_py34
def test_binop_matmult():
check_ast("x @ y", False)

Expand Down Expand Up @@ -681,46 +682,57 @@ def test_dict_three():
check_ast("{42: 65, 6: 28, 1: 2}")


@skip_if_py34
def test_dict_from_dict_two_xy():
check_ast('{"x": 1, **{"y": 2}}')


@skip_if_py34
def test_dict_from_dict_two_x_first():
check_ast('{"x": 1, **{"x": 2}}')


@skip_if_py34
def test_dict_from_dict_two_x_second():
check_ast('{**{"x": 2}, "x": 1}')


@skip_if_py34
def test_unpack_range_tuple():
check_stmts("*range(4),")


@skip_if_py34
def test_unpack_range_tuple_4():
check_stmts("*range(4), 4")


@skip_if_py34
def test_unpack_range_tuple_parens():
check_ast("(*range(4),)")


@skip_if_py34
def test_unpack_range_tuple_parens_4():
check_ast("(*range(4), 4)")


@skip_if_py34
def test_unpack_range_list():
check_ast("[*range(4)]")


@skip_if_py34
def test_unpack_range_list_4():
check_ast("[*range(4), 4]")


@skip_if_py34
def test_unpack_range_set():
check_ast("{*range(4)}")


@skip_if_py34
def test_unpack_range_set_4():
check_ast("{*range(4), 4}")

Expand Down Expand Up @@ -1085,14 +1097,17 @@ def test_call_dict_kwargs():
check_ast('dict(**{"base": 8})')


@skip_if_py34
def test_call_list_many_star_args():
check_ast("min(*[1, 2], 3, *[4, 5])")


@skip_if_py34
def test_call_list_many_starstar_args():
check_ast('dict(**{"a": 2}, v=3, **{"c": 5})')


@skip_if_py34
def test_call_list_many_star_and_starstar_args():
check_ast('x(*[("a", 2)], *[("v", 3)], **{"c": 5})', False)

Expand Down Expand Up @@ -1238,6 +1253,7 @@ def test_times_eq():
check_stmts("x = 42; x *= 2")


@skip_if_py34
def test_matmult_eq():
check_stmts("x @= y", False)

Expand Down Expand Up @@ -1633,6 +1649,7 @@ def test_for_else():
check_stmts("for x in range(6):\n pass\nelse: pass")


@skip_if_py34
def test_async_for():
check_stmts("async def f():\n async for x in y:\n pass\n", False)

Expand Down Expand Up @@ -1661,6 +1678,7 @@ def test_with_in_func():
check_stmts("def f():\n with x:\n pass\n")


@skip_if_py34
def test_async_with():
check_stmts("async def f():\n async with x as y:\n pass\n", False)

Expand Down Expand Up @@ -1996,14 +2014,17 @@ def test_function_blank_line():
check_stmts(code, False)


@skip_if_py34
def test_async_func():
check_stmts("async def f():\n pass\n")


@skip_if_py34
def test_async_decorator():
check_stmts("@g\nasync def f():\n pass", False)


@skip_if_py34
def test_async_await():
check_stmts("async def f():\n await fut\n", False)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from xonsh.prompt.base import PromptFormatter, PROMPT_FIELDS
from xonsh.prompt import vc

from tools import DummyEnv
from tools import skip_if_py34, DummyEnv


@pytest.fixture
Expand Down
3 changes: 2 additions & 1 deletion tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
)
from xonsh.environ import Env

from tools import skip_if_on_windows, skip_if_on_unix
from tools import skip_if_on_windows, skip_if_on_unix, skip_if_py34

LEXER = Lexer()
LEXER.build()
Expand Down Expand Up @@ -1653,6 +1653,7 @@ def test_iglobpath_no_dotfiles_recursive(xonsh_builtins):
assert d + "/bin/.someotherdotfile" not in files


@skip_if_py34
@skip_if_on_windows
def test_iglobpath_dotfiles_recursive(xonsh_builtins):
d = os.path.dirname(__file__)
Expand Down
2 changes: 2 additions & 0 deletions tests/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from xonsh.platform import ptk_version_info


VER_3_4 = (3, 4)
VER_3_5 = (3, 5)
VER_3_6 = (3, 6)
VER_MAJOR_MINOR = sys.version_info[:2]
Expand All @@ -35,6 +36,7 @@
TEST_DIR = os.path.dirname(__file__)

# pytest skip decorators
skip_if_py34 = pytest.mark.skipif(VER_MAJOR_MINOR < VER_3_5, reason="Py3.5+ only test")
skip_if_lt_py36 = pytest.mark.skipif(
VER_MAJOR_MINOR < VER_3_6, reason="Py3.6+ only test"
)
Expand Down
2 changes: 1 addition & 1 deletion xonsh-in-docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
parser = argparse.ArgumentParser(description=program_description)

parser.add_argument("env", nargs="*", default=[], metavar="ENV=value")
parser.add_argument("--python", "-p", default="3.5", metavar="python_version")
parser.add_argument("--python", "-p", default="3.4", metavar="python_version")
parser.add_argument("--pypy", default=None, metavar="pypy_version")
parser.add_argument("--ptk", "-t", default="2.0.4", metavar="ptk_version")
parser.add_argument("--keep", action="store_true")
Expand Down
2 changes: 2 additions & 0 deletions xonsh/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ def Parser():
from xonsh.parsers.v36 import Parser as p
elif PYTHON_VERSION_INFO > (3, 5):
from xonsh.parsers.v35 import Parser as p
else:
from xonsh.parsers.v34 import Parser as p
return p
Loading

0 comments on commit 002a317

Please sign in to comment.