diff options
author | Anthon van der Neut <anthon@mnt.org> | 2015-05-28 12:50:15 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2015-05-28 12:50:15 +0200 |
commit | 289970ec0900d8b44b25137361a2e70e0f99d10e (patch) | |
tree | 42b498a57d5d59d8de8226976e1aff9c60386b46 | |
parent | 59d53c586983dd5cb2ee6cfc7111dd233f50cddd (diff) | |
download | ruamel.yaml-289970ec0900d8b44b25137361a2e70e0f99d10e.tar.gz |
- tests run on windows 2.6. and 2.7 (3.3/3.4 have someinstall problems)
- generate .whl for various windows version/platform combination (universal)
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | make_win_whl.py | 32 | ||||
-rw-r--r-- | py/__init__.py | 2 | ||||
-rw-r--r-- | setup.py | 7 | ||||
-rw-r--r-- | test/test_util.py | 11 |
5 files changed, 48 insertions, 7 deletions
@@ -6,6 +6,9 @@ REGEN:=/home/bin/ruamel_util_new util --published --command YAML --skip-hg include ~/.config/ruamel_util_new/Makefile.inc +gen_win_whl: + @python make_win_whl.py dist/$(PKGNAME)-$(VERSION)-*-none-any.whl + clean: clean_common diff --git a/make_win_whl.py b/make_win_whl.py new file mode 100644 index 0000000..0273d2b --- /dev/null +++ b/make_win_whl.py @@ -0,0 +1,32 @@ + +""" +The windows whl file has no C stuff but a +ruamel.yaml-0.9.2-py2-none-any.whl file overrules the .tar.gz on Linux. + +You can create a .whl and copy it to impure names (or start +with an impure one), not sure if this is necessary. + +""" + +import sys +import os +import shutil + + +def main(): + src = sys.argv[1] + print src, '-->' + dir_name = os.path.dirname(src) + base_name = os.path.basename(src) + p, v, rest = base_name.split('-', 2) + #print dir_name + for pyver in ['cp26', 'cp27', 'cp33', 'cp34']: + for platform in ['win32', 'win_amd64']: + dst = os.path.join(dir_name, + '%s-%s-%s-none-%s.whl' % ( + p, v, pyver, platform + )) + print dst + shutil.copy(src, dst) + +main()
\ No newline at end of file diff --git a/py/__init__.py b/py/__init__.py index 3ab81ad..f98310f 100644 --- a/py/__init__.py +++ b/py/__init__.py @@ -21,7 +21,7 @@ def _convert_version(tup): return ret_val -version_info = (0, 9, 2) +version_info = (0, 9, 3) __version__ = _convert_version(version_info) del _convert_version @@ -63,9 +63,14 @@ version_str = _check_convert_version(version_info) if __name__ == '__main__': # put here so setup.py can be imported more easily - from setuptools import setup, find_packages, Extension + from setuptools import setup, find_packages, Extension, Distribution from setuptools.command import install_lib + # windows things this is pure, that way you would get pure python + # whl files that take precedence on Linux over source with compilable C + Distribution.is_pure = lambda *args: True + + class MyInstallLib(install_lib.install_lib): "create __init__.py on the fly" diff --git a/test/test_util.py b/test/test_util.py index 612d2d8..4701dc5 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -38,7 +38,7 @@ def call_util(s, file_name, cmd, mp, td): with io.open(file_name, 'w') as fp: fp.write(dedent(s)) res = check_output(cmd, stderr=subprocess.STDOUT) - return res + return res.replace('\r\n', '\n') def rt_test(s, file_name, mp, td): @@ -50,7 +50,8 @@ class TestUtil: def test_version(self, capsys): res = check_output( ['yaml', '--version'], stderr=subprocess.STDOUT) - assert res == u"version: {0}\n".format(ruamel.yaml.__version__) + assert res.replace('\r\n', '\n') == \ + u"version: {0}\n".format(ruamel.yaml.__version__) def test_ok(self, tmpdir, monkeypatch): file_name = "00_ok.yaml" @@ -68,7 +69,7 @@ class TestUtil: - ghi # some comment - klm """, file_name, mp=monkeypatch, td=tmpdir) - assert res == dedent(""" + assert res.replace('\r\n', '\n') == dedent(""" {file_name}: stabelizes on second round trip, ok without comments --- 01_second_rt_ok.yaml @@ -117,7 +118,7 @@ class TestUtil: """, file_name, ['yaml', 'from-ini', file_name], mp=monkeypatch, td=tmpdir) print(res) - assert res == dedent(""" + assert res.replace('\r\n', '\n') == dedent(""" # initial comment keyword1: value1 keyword2: value2 @@ -182,7 +183,7 @@ class TestUtil: file_name, ['yaml', 'from-ini', file_name], mp=monkeypatch, td=tmpdir) print(res) - assert res == dedent(""" + assert res.replace('\r\n', '\n') == dedent(""" # initial comment keyword1: value1 keyword2: value2 # eol comment kw2 |