Skip to content

Commit 32f28e5

Browse files
committed
version 0.6.0 support for Python 3 and creating wheels
1 parent f1ff375 commit 32f28e5

File tree

8 files changed

+55
-40
lines changed

8 files changed

+55
-40
lines changed

README.md

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ XML Menu Diff
66

77
Compare the content of two XML trigger menus.
88

9-
$ tm-diff [-f|--format <format>] [-s|--skip <mode>] [--sort <key>]
10-
[-d|--dump] [-o <file>]
11-
<file1> <file2>
9+
```bash
10+
tm-diff [-f|--format <format>] [-s|--skip <mode>] [--sort <key>]
11+
[-d|--dump] [-o <file>]
12+
<file1> <file2>
13+
```
1214

1315
### Format
1416

@@ -23,7 +25,9 @@ Default format is `unified`.
2325

2426
**Example:**
2527

26-
$ tm-diff ... -fhtml -o diff.html # dumps diff as HTML table to file
28+
```bash
29+
tm-diff ... -fhtml -o diff.html # dumps diff as HTML table to file
30+
```
2731

2832
### Skip
2933

@@ -34,7 +38,9 @@ Use flag `-s|--skip <mode>` to ignore certain attributes. Options are
3438

3539
**Example:**
3640

37-
$ tm-diff ... -smodule -scomment # ignores module_is/index and any comments
41+
```bash
42+
tm-diff ... -smodule -scomment # ignores module_is/index and any comments
43+
```
3844

3945
### Sort
4046

@@ -53,33 +59,46 @@ option will create two text files with the menu names at the current working loc
5359

5460
**Example:**
5561

56-
$ tm-diff foo.xml bar.xml -d # dumps raw text to foo.xml.txt bar.xml.txt
62+
```bash
63+
tm-diff foo.xml bar.xml -d # dumps raw text to foo.xml.txt bar.xml.txt
64+
```
5765

5866
### Output
5967

6068
Use flag `-o <file>` to write the output to a file.
6169

6270
**Example:**
6371

64-
$ tm-diff foo.xml bar.xml -o diff.txt # write output to file
72+
```bash
73+
tm-diff foo.xml bar.xml -o diff.txt # write output to file
74+
```
6575

6676
This is equivalent to:
6777

68-
$ tm-diff foo.xml bar.xml > diff.txt # pipe stdout to file
69-
78+
```bash
79+
tm-diff foo.xml bar.xml > diff.txt # pipe stdout to file
80+
```
7081

7182
## Dependencies
7283

73-
* `tmTable`
84+
Install following l1t-utm wheel or build l1t-utm python bindings.
85+
86+
* `tmTable>=0.7.3`
87+
7488

75-
**Note:** make sure to set `UTM_ROOT` before executing.
89+
## Install
7690

91+
Install using pip
7792

78-
## Setup
93+
```bash
94+
pip install https://github.com/cms-l1-globaltrigger/tm-diff/archive/master.zip#egg=tm-diff-0.6.0
95+
```
7996

80-
$ . /path/to/utm-0.6.x/setup.sh # source UTM environment
97+
Install from local source
8198

82-
$ git clone https://gitlab.cern.ch/.../tm-diff.git
83-
$ cd tm-diff
84-
$ . setup.sh
85-
$
99+
```bash
100+
git clone https://gitlab.cern.ch/cms-l1-globaltrigger/tm-diff.git
101+
cd tm-diff
102+
python setup.py test
103+
python setup.py install
104+
```

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#tmTable>=0.7.3

setup.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1-
from distutils.core import setup
2-
from tmDiff import __version__ as version
1+
from setuptools import setup
32

43
long_description = open('README.md').read()
54

65
setup(
76
name="tm-diff",
8-
version=version,
7+
version='0.6.0',
98
url="https://github.com/cms-l1-globaltrigger/tm-diff",
109
author="Bernhard Arnold",
1110
author_email="bernhard.arnold@cern.ch",
1211
description="Compare the content of two XML trigger menus.",
1312
long_description=long_description,
14-
packages=["tmDiff"],
15-
scripts=["scripts/tm-diff"],
13+
packages=['tmDiff'],
14+
install_requires=[
15+
#'tmTable>=0.7.3',
16+
],
17+
entry_points={
18+
'console_scripts': [
19+
'tm-diff = tmDiff.main:main',
20+
],
21+
},
22+
test_suite='tests',
1623
license="GPLv3",
1724
keywords="",
1825
platforms="any",

setup.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/__init__.py

Whitespace-only changes.

tmDiff/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
# -*- coding: utf-8 -*-
2-
3-
__version__ = '0.5.0'
1+
__version__ = '0.6.0'

scripts/tm-diff renamed to tmDiff/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import argparse
44
import sys, os
55

6-
from tmDiff import menudiff
7-
from tmDiff import __version__
6+
from . import menudiff
7+
from . import __version__
88

99
FMT_UNIFIED = 'unified'
1010
FMT_CONTEXT = 'context'
@@ -112,11 +112,11 @@ def main():
112112
DIFF_FUNCTIONS[args.format](
113113
fromfile=from_menu,
114114
tofile=to_menu,
115-
verbose=args.verbose > 0,
115+
verbose=args.verbose,
116116
ostream=args.ostream
117117
)
118118

119-
sys.exit()
119+
return 0
120120

121121
if __name__ == '__main__':
122-
main()
122+
sys.exit(main())

tmDiff/menudiff.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
#
31
# Diff for XML menus
42
#
53
# The algorithm specific content is extracted into a simple text representation

0 commit comments

Comments
 (0)