Skip to content

Commit 4c00a28

Browse files
author
rocky
committed
Get ready for release 1.0.0
1 parent a077f4f commit 4c00a28

File tree

12 files changed

+1180
-24
lines changed

12 files changed

+1180
-24
lines changed

ChangeLog

Lines changed: 1005 additions & 0 deletions
Large diffs are not rendered by default.

MANIFEST.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include README.rst
2+
include AUTHORS
3+
include CONTRIBUTE.rst
4+
include NEWS.md
5+
include ChangeLog
6+
include __pkginfo__.py
7+
include setup.py
8+
recursive-include xpython *.py
9+
recursive-include test *.py
10+
recursive-exclude test __pycache__

NEWS.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
1.0.0 2020-05-02 Segundo de mayo
2+
================================
3+
4+
A One oh release - you know what that means.
5+
6+
There have been numerous changes since byterun.
7+
8+
Probably of most interest is probably support for newer Pythons - 3.4 and some 3.5. 3.5 is still a little weak. Using routines from [xdis](https://github.com/rocky/python-xdis) we added support for wordcode (when we get around to 3.6+) and `EXTENDED_ARGS` which is more prevelant when wordcodes are in use, since an operand size is only one byte without the "extended arg" prefix.
9+
10+
Since we are using `xdis`, we have the ability to read and parse bytecode files from a version of Python different from the one running. Making use of this, `xpython` can accept a bytecode file in addition to accepting Python source code.
11+
12+
We also added support for Python 2.6, 2.5 and 3.2. Since the `x-python` doesn't run before Python 2.7, bytecode for 2.5 and 2.6 must be supplied for those versions.
13+
14+
The code has been reorganized to allow support for more bytecode and to be able to scale testing to a much greater extent. (I will say that the tests that were byterun were generally pretty good for the kinds of things it tests).
15+
16+
The level of verbosity on `nosetest -s` has been reduced by removing the disassembly listing by default. If you want a disassembly listing, consider `pydisasm` from the `xdis` package. This works because I've pulled out many of the Python test programs from strings in the tests to individual files. This makes it much easier to debug individual problems with those tests. And it makes the test files much shorter, at the expense of more files in a test directory. However I consider that good. If the test file is a real Python file then when you edit your editor will better understand what's in the string, and you can compile it and get lint on it. Oh, and it makes it easier to write comments describing more about what's up with the test.
17+
18+
Some of the bugs in `MAKE_FUNCTION` have been fixed. (It is expect that these would appear since Python function signatures are complicated the internal have changed numerous times between releases.
19+
20+
Some command options have now change. Of note is `-v` is now `--debug-level`, `-d` which takes an integer parameter which specifies the level of verbosity. `-d1` gives a trace of instructions while `-d2` includes the block and evaluation stack. In general I'll try to follow the Python command options, and `-d`, not `-v` is what CPython uses.

__pkginfo__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
author='Rocky Bernstein, Ned Batchelder, Paul Swartz, Allison Kaptur and others',
2-
author_email='[email protected]',
1+
author='Rocky Bernstein, Ned Batchelder, Paul Swartz, Allison Kaptur and others'
2+
author_email='[email protected]'
33
entry_points = {"console_scripts": ["xpython=xpython.__main__:main"]}
44
install_requires=["six", "xdis", "click"],
55
short_desc = "Python cross-version byte-code interpeter"
@@ -9,7 +9,6 @@
99
"Programming Language :: Python :: 2.7",
1010
"Programming Language :: Python :: 3.3",
1111
"Programming Language :: Python :: 3.4",
12-
"Programming Language :: Python :: 3.5",
1312
]
1413
import os.path as osp
1514

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
2+
**Table of Contents**
3+
4+
- [Get latest sources:](#get-latest-sources)
5+
- [Change version in xdis/version.py.](#change-version-in-xdisversionpy)
6+
- [Update ChangeLog:](#update-changelog)
7+
- [Update NEWS.md from ChangeLog. Then:](#update-newsmd-from-changelog-then)
8+
- [Make sure pyenv is running and check newer versions](#make-sure-pyenv-is-running-and-check-newer-versions)
9+
- [Update NEWS.md from master branch](#update-newsmd-from-master-branch)
10+
- [Make packages and tag](#make-packages-and-tag)
11+
- [Upload](#upload)
12+
- [Upload rest of versions](#upload-rest-of-versions)
13+
- [Push tags:](#push-tags)
14+
- [Check on a VM](#check-on-a-vm)
15+
16+
<!-- markdown-toc end -->
17+
18+
# Get latest sources:
19+
20+
$ git pull
21+
22+
# Change version in xdis/version.py.
23+
24+
$ emacs xpython/version.py
25+
$ source xpython/version.py
26+
$ echo $VERSION
27+
$ git commit -m"Get ready for release $VERSION" .
28+
29+
30+
# Update ChangeLog:
31+
32+
$ make ChangeLog
33+
34+
# Update NEWS.md from ChangeLog. Then:
35+
36+
$ emacs NEWS.md
37+
$ make check
38+
$ git commit --amend .
39+
$ git push # get CI testing going early
40+
$ make check-full
41+
42+
# Update NEWS.md from master branch
43+
44+
$ git commit -m"Get ready for release $VERSION" .
45+
46+
# Make packages and tag
47+
48+
$ . ./admin-tools/make-dist.sh
49+
$ twine check dist/x-python-$VERSION*
50+
51+
Goto https://github.com/rocky/x-python/releases/new
52+
53+
54+
# Upload
55+
56+
$ twine upload dist/xdis-${VERSION}*
57+
58+
Check on https://pypi.org/project/x-python/
59+
60+
# Upload rest of versions
61+
62+
$ twine upload dist/xdis-${VERSION}*
63+
64+
# Push tags:
65+
66+
$ git push --tags
67+
68+
# Check on a VM
69+
70+
$ cd /virtual/vagrant/virtual/vagrant/ubuntu-zesty
71+
$ vagrant up
72+
$ vagrant ssh
73+
$ pyenv local 3.5.2
74+
$ pip install --upgrade xdis
75+
$ exit
76+
$ vagrant halt

setup.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from distutils.core import setup
44

5+
from setuptools import setup
56
from __pkginfo__ import (
67
author,
78
author_email,
@@ -18,13 +19,12 @@
1819
name="x-python",
1920
version=VERSION,
2021
author=author,
21-
author_email = author_email,
22-
classifiers = classifiers,
23-
description = short_desc,
24-
entry_points = entry_points,
25-
long_description = long_description,
26-
long_description_content_type = "text/x-rst",
27-
packages = ["xpython"],
28-
install_requires = install_requires,
29-
url=url,
22+
author_email=author_email,
23+
description=short_desc,
24+
entry_points=entry_points,
25+
long_description=long_description,
26+
long_description_content_type="text/x-rst",
27+
packages=["xpython"],
28+
install_requires=install_requires,
29+
url=url
3030
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from contextlib import contextmanager
2+
3+
def inner():
4+
yield "I'm inner!"
5+
6+
def foo():
7+
yield from inner()
8+
9+
@contextmanager
10+
def cmgr():
11+
yield "Context Manager!"
12+
raise StopIteration(cmgr())
13+
14+
def main():
15+
with (yield from foo()) as x:
16+
print(x)
17+
18+
def run(fn, *args):
19+
x = fn(*args)
20+
while True:
21+
try:
22+
print(next(x))
23+
except StopIteration as e:
24+
return e.value
25+
run(main)

xpython/__main__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@
66

77
from xpython import execfile
88
from xpython.version import VERSION
9+
from xdis import PYTHON_VERSION
10+
11+
def version_message():
12+
mess = "xpython, version %s running from Python %s" % (
13+
VERSION, PYTHON_VERSION
14+
)
15+
return mess
916

1017
@click.command()
11-
@click.version_option(version=VERSION)
18+
@click.version_option(version_message(), "-V", "--version")
1219
@click.option("-m", "--module", default=False,
1320
help="PATH is a module name, not a Python main program")
1421
@click.option("-d", "--debug-level", default=0,

xpython/byteop/byteop32.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
"""Byte Interpreter operations for Python 3.2
23
"""
34
from __future__ import print_function, division

xpython/byteop/byteop33.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
"""Byte Interpreter operations for Python 3.3
23
"""
34
from __future__ import print_function, division

0 commit comments

Comments
 (0)