Skip to content

Commit

Permalink
Modernize python versions (keep py27) and fix spec_test load cmd
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen L Arnold <[email protected]>
  • Loading branch information
sarnold committed Oct 18, 2021
1 parent 6d151c1 commit 62123bd
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "ext/spec"]
path = ext/spec
url = http://github.com/mustache/spec.git
url = https://github.com/mustache/spec.git
46 changes: 42 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
dist: xenial
language: python

# Travis CI has no plans to support Jython and no longer supports Python 2.5.
python:
- 2.6
- 2.7
- 3.2
- pypy
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9-dev"
- "nightly"

matrix:
fast_finish: true
include:
- os: osx
# osx is goofy, ``python`` is always py2, images mutate fast
language: shell
before_install:
- pip3 install --upgrade pip wheel
install:
- python3 setup.py install
script:
- pystache-test . ext/spec/specs
- os: windows
# windows is even goofier, install path is different for python/python3
# but either way you get python3 and the cmd is always ``python`` o.O
# (also versions mutuate like bacteria)
language: shell
before_install:
- choco install python3 --params "/InstallDir:C:\\Python"
- python -m pip install --upgrade pip wheel
env: PATH="/c/Python:/c/Python/Scripts:$PATH"
install:
- python setup.py install
script:
- pystache-test . ext/spec/specs
allow_failures:
- python: "nightly"

# command to install dependencies
install:
- pip install --upgrade pip
- pip install codecov

script:
- python setup.py install
# Include the spec tests directory for Mustache spec tests and the
# project directory for doctests.
- pystache-test . ext/spec/specs
#- tox
4 changes: 2 additions & 2 deletions pystache/tests/spectesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ def code_constructor(loader, node):
value = loader.construct_mapping(node)
return eval(value['python'], {})

yaml.add_constructor('!code', code_constructor)
return yaml.load(u)
yaml.add_constructor(u'!code', code_constructor)
return yaml.full_load(u)


class SpecTestBase(unittest.TestCase, AssertStringMixin):
Expand Down
13 changes: 6 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,13 @@
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.4',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'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 :: Implementation :: PyPy',
)

Expand Down Expand Up @@ -382,7 +381,7 @@ def main(sys_argv):
author_email='[email protected]',
maintainer='Chris Jerdonek',
maintainer_email='[email protected]',
url='http://github.com/defunkt/pystache',
url='https://github.com/defunkt/pystache',
install_requires=INSTALL_REQUIRES,
packages=PACKAGES,
package_data = {
Expand Down
11 changes: 10 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
[tox]
# Tox 1.4 drops py24 and adds py33. In the current version, we want to
# support 2.4, so we can't simultaneously support 3.3.
envlist = py24,py25,py26,py27,py27-yaml,py27-noargs,py31,py32,pypy
envlist = py27-yaml,py27-noargs,py3{5,6,7,8,9}
skip_missing_interpreters = true

[tox:travis]
2.7 = py27-yaml
3.5 = py35
3.6 = py36
3.7 = py37
3.8 = py38
3.9 = py39

[testenv]
# Change the working directory so that we don't import the pystache located
Expand Down

0 comments on commit 62123bd

Please sign in to comment.