Skip to content

Commit 78c8722

Browse files
committed
Refine
1 parent 720cf8a commit 78c8722

File tree

4 files changed

+21
-29
lines changed

4 files changed

+21
-29
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
*.egg-info/
2-
.eggs/
32
.tox/
43
build/
54
dist/
6-
*.egg
7-
*.py[cd]
5+
*.py?
86
*.so
97
*.sw?
108
.coverage

README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Requirements
3131
------------
3232

3333
- Python 3.8+
34-
- setuptools
3534

3635

3736
Usage

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ readme = "README.rst"
1212
authors = [
1313
{name = "Akinori Hattori", email = "[email protected]"},
1414
]
15-
license = {"text" = "ALv2"}
15+
license = {text = "ALv2"}
1616
classifiers = [
1717
"Development Status :: 5 - Production/Stable",
1818
"Intended Audience :: Developers",
@@ -39,7 +39,9 @@ Homepage = "https://github.com/hattya/zopflipy"
3939

4040
[tool.setuptools]
4141
include-package-data = false
42-
packages = ["zopfli"]
42+
packages = [
43+
"zopfli",
44+
]
4345

4446
[tool.setuptools.package-data]
4547
zopfli = [

setup.py

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,14 @@
99
from setuptools import setup, Command, Extension
1010

1111

12-
zopfli_dir = os.path.join('zopfli', '_zopfli', 'zopfli', 'src')
13-
14-
15-
def list_sources(path, exts):
16-
srcs = []
12+
def sources(path, exts):
1713
for root, dirs, files in os.walk(path):
1814
dirs[:] = (d for d in dirs if not d.startswith('.'))
1915
for f in files:
2016
n, ext = os.path.splitext(f)
2117
if (ext in exts
2218
and not n.endswith('_bin')):
23-
srcs.append(os.path.normpath(os.path.join(root, f)))
24-
return srcs
19+
yield os.path.normpath(os.path.join(root, f))
2520

2621

2722
class test(Command):
@@ -52,19 +47,17 @@ def run(self):
5247
unittest.main(None, argv=argv)
5348

5449

55-
ext_modules = [Extension('zopfli._zopfli',
56-
include_dirs=[zopfli_dir],
57-
sources=list_sources('.', ['.c', '.cc', '.cpp']))]
58-
59-
cmdclass = {
60-
'test': test,
61-
}
62-
63-
setup(ext_modules=ext_modules,
64-
cmdclass=cmdclass,
65-
scmver={
66-
'root': os.path.dirname(os.path.abspath(__file__)),
67-
'spec': 'micro',
68-
'write_to': os.path.join('zopfli', '__version__.py'),
69-
'fallback': ['__version__:version', 'zopfli'],
70-
})
50+
setup(
51+
ext_modules=[Extension('zopfli._zopfli',
52+
include_dirs=[os.path.join('zopfli', '_zopfli', 'zopfli', 'src')],
53+
sources=list(sources('zopfli', ['.c', '.cc', '.cpp'])))],
54+
cmdclass={
55+
'test': test,
56+
},
57+
scmver={
58+
'root': os.path.dirname(os.path.abspath(__file__)),
59+
'spec': 'micro',
60+
'write_to': os.path.join('zopfli', '__version__.py'),
61+
'fallback': ['__version__:version', 'zopfli'],
62+
},
63+
)

0 commit comments

Comments
 (0)