Skip to content

Commit 3305daa

Browse files
committed
Merge branch '1.3.x'
2 parents 688392a + f5a03ef commit 3305daa

File tree

6 files changed

+51
-41
lines changed

6 files changed

+51
-41
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,30 @@ jobs:
1919
runs-on: ${{ matrix.os }}
2020
strategy:
2121
matrix:
22-
os: [ubuntu-22.04, macos-latest]
23-
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "pypy3.9"]
22+
os: [ubuntu-latest, macos-latest]
23+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.10"]
2424
include:
25-
- os: ubuntu-22.04
26-
python-version: "2.7"
27-
- os: windows-latest
28-
python-version: 3.9
29-
- os: windows-latest
30-
python-version: "3.10"
3125
- os: windows-latest
3226
python-version: "3.11"
3327
- os: windows-latest
3428
python-version: "3.12"
29+
- os: windows-latest
30+
python-version: "3.13"
3531
exclude:
3632
- os: macos-latest
37-
python-version: 3.5
33+
python-version: 3.9
3834
- os: macos-latest
39-
python-version: 3.6
35+
python-version: 3.10
4036
- os: macos-latest
41-
python-version: "pypy3.9"
37+
python-version: "pypy3.10"
4238

4339

4440
steps:
4541
- uses: actions/checkout@v3
4642
- name: Set up Python ${{ matrix.python-version }} via setup-python
47-
if: matrix.python-version != '2.7'
4843
uses: actions/setup-python@v4
4944
with:
5045
python-version: ${{ matrix.python-version }}
51-
- name: Set up Python ${{ matrix.python-version }} via apt-get
52-
if: matrix.python-version == '2.7'
53-
run: |
54-
set -eux
55-
sudo apt-get update
56-
sudo apt-get install -y python2 python3-virtualenv
57-
virtualenv -p python2 "${{ runner.temp }}/venv"
58-
echo "${{ runner.temp }}/venv/bin" >> $GITHUB_PATH
5946
- name: Install dependencies
6047
run: |
6148
python -m pip install --upgrade pip
@@ -75,7 +62,7 @@ jobs:
7562
coverage report -m
7663
continue-on-error: true
7764
- name: Coveralls
78-
if: ${{ matrix.os == 'ubuntu-22.04' && matrix.python-version != '2.7' && matrix.python-version != 'pypy2' }}
65+
if: ${{ matrix.os == 'ubuntu-22.04' }}
7966
env:
8067
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8168
run: |

CHANGES.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
=========
33

4+
1.3.2 - 2024-10-17
5+
------------------
6+
7+
- Ensure building from source tree under Python 3.13 works.
8+
- Dropped support for building under Python 2 in source tree. [
9+
`#44 <https://github.com/calmjs/calmjs.parse/issues/44>`_
10+
]
11+
412
1.3.1 - 2023-10-28
513
------------------
614

@@ -9,7 +17,9 @@ Changelog
917
those modules are missing and the required dependencies for are not
1018
present (i.e. ``ply`` and ``setuptools``), the build will result in a
1119
non-zero exit status and the documented error message should reflect
12-
which of the required dependencies are missing.
20+
which of the required dependencies are missing. [
21+
`#41 <https://github.com/calmjs/calmjs.parse/issues/41>`_
22+
]
1323

1424
1.3.0 - 2021-10-08
1525
------------------

appveyor.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,8 @@ image: Visual Studio 2022
22

33
environment:
44
matrix:
5-
- PYTHON: "C:\\Python27"
6-
- PYTHON: "C:\\Python33"
7-
- PYTHON: "C:\\Python34"
8-
- PYTHON: "C:\\Python35"
9-
- PYTHON: "C:\\Python36"
10-
- PYTHON: "C:\\Python37"
11-
- PYTHON: "C:\\Python38"
12-
- PYTHON: "C:\\Python39-x64"
13-
- PYTHON: "C:\\Python310-x64"
14-
- PYTHON: "C:\\Python311-x64"
5+
- PYTHON: "C:\\Python312-x64"
6+
- PYTHON: "C:\\Python313-x64"
157

168
install:
179
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
@@ -21,7 +13,9 @@ install:
2113
test_script:
2214
- python setup.py develop
2315
- coverage run --include=src\* -m unittest calmjs.parse.tests.make_suite
24-
- coverage report -m
16+
# This is now broken on appveyor for whatever reason. Why does Python
17+
# and their tools just break?
18+
# - coverage report -m
2519

2620
artifacts:
2721
- path: dist\*

setup.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import sys
3-
from setuptools import setup, find_packages
3+
from setuptools import setup
44
from setuptools.command.build_py import build_py
55
from subprocess import call
66

@@ -29,7 +29,6 @@ def __init__(self, *a, **kw):
2929
License :: OSI Approved :: MIT License
3030
Operating System :: OS Independent
3131
Programming Language :: JavaScript
32-
Programming Language :: Python :: 2.7
3332
Programming Language :: Python :: 3.3
3433
Programming Language :: Python :: 3.4
3534
Programming Language :: Python :: 3.5
@@ -40,6 +39,7 @@ def __init__(self, *a, **kw):
4039
Programming Language :: Python :: 3.10
4140
Programming Language :: Python :: 3.11
4241
Programming Language :: Python :: 3.12
42+
Programming Language :: Python :: 3.13
4343
""".strip().splitlines()
4444

4545
long_description = (
@@ -61,9 +61,14 @@ def __init__(self, *a, **kw):
6161
author_email='[email protected]',
6262
url='https://github.com/calmjs/calmjs.parse',
6363
license='mit',
64-
packages=find_packages('src'),
65-
package_dir={'': 'src'},
66-
namespace_packages=['calmjs'],
64+
# To build this under Python 2, create src/calmjs/__init__.py with
65+
#
66+
# __import__('pkg_resources').declare_namespace(__name__)
67+
#
68+
# and uncomment the following:
69+
# packages=find_packages('src'),
70+
# package_dir={'': 'src'},
71+
# namespace_packages=['calmjs'],
6772
include_package_data=True,
6873
zip_safe=False,
6974
cmdclass={
@@ -73,6 +78,7 @@ def __init__(self, *a, **kw):
7378
'setuptools',
7479
'ply>=3.6',
7580
],
81+
python_requires='>=3.3',
7682
entry_points={
7783
},
7884
test_suite="calmjs.parse.tests.make_suite",

src/calmjs/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/calmjs/parse/tests/__init__.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import doctest
77
from textwrap import dedent
88
from io import StringIO
9+
from os.path import basename
910
from os.path import dirname
1011
from pkg_resources import get_distribution
1112

@@ -31,14 +32,27 @@
3132
}
3233

3334

35+
class StringIOWrapper(StringIO):
36+
"""
37+
Needed to rstrip the output to make all doctest output behave in a
38+
consistent way across all platforms because for whatever reason the
39+
doctest has different behaviors between Windows and others...
40+
"""
41+
42+
def read(self):
43+
return StringIO.read(self).rstrip()
44+
45+
3446
def make_suite(): # pragma: no cover
3547
from calmjs.parse.lexers import es5 as es5lexer
3648
from calmjs.parse import walkers
3749
from calmjs.parse import sourcemap
3850

3951
def open(p, flag='r'):
40-
result = StringIO(examples[p] if flag == 'r' else '')
41-
result.name = p
52+
result = StringIOWrapper(examples[p] if flag == 'r' else '')
53+
# Need basename here because Python 3.13 under Windows broke
54+
# _something_ and made the reporting inconsistent...
55+
result.name = basename(p)
4256
return result
4357

4458
parser = doctest.DocTestParser()

0 commit comments

Comments
 (0)