|
5 | 5 |
|
6 | 6 | def read(rel_path):
|
7 | 7 | base_path = os.path.abspath(os.path.dirname(__file__))
|
8 |
| - with open(os.path.join(base_path, rel_path), 'r') as f: |
| 8 | + with open(os.path.join(base_path, rel_path), "r") as f: |
9 | 9 | return f.read()
|
10 | 10 |
|
11 | 11 |
|
12 | 12 | def get_version(rel_path):
|
13 | 13 | for line in read(rel_path).splitlines():
|
14 |
| - if line.startswith('__version__'): |
| 14 | + if line.startswith("__version__"): |
15 | 15 | # __version__ = "0.9"
|
16 | 16 | delim = '"' if '"' in line else "'"
|
17 | 17 | return line.split(delim)[1]
|
18 | 18 |
|
19 |
| - raise RuntimeError('Unable to find version string.') |
| 19 | + raise RuntimeError("Unable to find version string.") |
20 | 20 |
|
21 | 21 |
|
22 |
| -if __name__ == '__main__': |
| 22 | +if __name__ == "__main__": |
23 | 23 | setuptools.setup(
|
24 |
| - name='pytorch-fid', |
25 |
| - version=get_version(os.path.join('src', 'pytorch_fid', '__init__.py')), |
26 |
| - author='Max Seitzer', |
27 |
| - description=('Package for calculating Frechet Inception Distance (FID)' |
28 |
| - ' using PyTorch'), |
29 |
| - long_description=read('README.md'), |
30 |
| - long_description_content_type='text/markdown', |
31 |
| - url='https://github.com/mseitzer/pytorch-fid', |
32 |
| - package_dir={'': 'src'}, |
33 |
| - packages=setuptools.find_packages(where='src'), |
| 24 | + name="pytorch-fid", |
| 25 | + version=get_version(os.path.join("src", "pytorch_fid", "__init__.py")), |
| 26 | + author="Max Seitzer", |
| 27 | + description=( |
| 28 | + "Package for calculating Frechet Inception Distance (FID)" " using PyTorch" |
| 29 | + ), |
| 30 | + long_description=read("README.md"), |
| 31 | + long_description_content_type="text/markdown", |
| 32 | + url="https://github.com/mseitzer/pytorch-fid", |
| 33 | + package_dir={"": "src"}, |
| 34 | + packages=setuptools.find_packages(where="src"), |
34 | 35 | classifiers=[
|
35 |
| - 'Programming Language :: Python :: 3', |
36 |
| - 'License :: OSI Approved :: Apache Software License', |
| 36 | + "Programming Language :: Python :: 3", |
| 37 | + "License :: OSI Approved :: Apache Software License", |
37 | 38 | ],
|
38 |
| - python_requires='>=3.5', |
| 39 | + python_requires=">=3.5", |
39 | 40 | entry_points={
|
40 |
| - 'console_scripts': [ |
41 |
| - 'pytorch-fid = pytorch_fid.fid_score:main', |
| 41 | + "console_scripts": [ |
| 42 | + "pytorch-fid = pytorch_fid.fid_score:main", |
42 | 43 | ],
|
43 | 44 | },
|
44 | 45 | install_requires=[
|
45 |
| - 'numpy', |
46 |
| - 'pillow', |
47 |
| - 'scipy', |
48 |
| - 'torch>=1.0.1', |
49 |
| - 'torchvision>=0.2.2' |
| 46 | + "numpy", |
| 47 | + "pillow", |
| 48 | + "scipy", |
| 49 | + "torch>=1.0.1", |
| 50 | + "torchvision>=0.2.2", |
50 | 51 | ],
|
51 |
| - extras_require={'dev': ['flake8', |
52 |
| - 'flake8-bugbear', |
53 |
| - 'flake8-isort', |
54 |
| - 'nox']}, |
| 52 | + extras_require={ |
| 53 | + "dev": ["flake8", "flake8-bugbear", "flake8-isort", "black==24.3.0", "nox"] |
| 54 | + }, |
55 | 55 | )
|
0 commit comments