Skip to content

Commit

Permalink
Update setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cgohlke committed Aug 30, 2023
1 parent 4722129 commit 3fa7f93
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

"""Roifile package setuptools script."""

import sys
import re
import sys

from setuptools import setup

Expand All @@ -16,10 +16,10 @@ def search(pattern, code, flags=0):
return match.groups()[0]


with open('roifile/roifile.py') as fh:
with open('roifile/roifile.py', encoding='utf-8') as fh:
code = fh.read()

version = search(r"__version__ = '(.*?)'", code)
version = search(r"__version__ = '(.*?)'", code).replace('.x.x', '.dev0')

description = search(r'"""(.*)\.(?:\r\n|\r|\n)', code)

Expand All @@ -42,10 +42,10 @@ def search(pattern, code, flags=0):
license = license.replace('# ', '').replace('#', '')

if 'sdist' in sys.argv:
with open('LICENSE', 'w') as fh:
with open('LICENSE', 'w', encoding='utf-8') as fh:
fh.write('BSD 3-Clause License\n\n')
fh.write(license)
with open('README.rst', 'w') as fh:
with open('README.rst', 'w', encoding='utf-8') as fh:
fh.write(readme)

setup(
Expand All @@ -54,6 +54,7 @@ def search(pattern, code, flags=0):
license='BSD',
description=description,
long_description=readme,
long_description_content_type='text/x-rst',
author='Christoph Gohlke',
author_email='cgohlke@cgohlke.com',
url='https://www.cgohlke.com',
Expand All @@ -63,8 +64,9 @@ def search(pattern, code, flags=0):
# 'Documentation': 'https://',
},
packages=['roifile'],
package_data={'roifile': ['py.typed']},
entry_points={'console_scripts': ['roifile = roifile.roifile:main']},
python_requires='>=3.8',
python_requires='>=3.9',
install_requires=['numpy'],
extras_require={'all': ['matplotlib', 'tifffile']},
platforms=['any'],
Expand All @@ -78,5 +80,6 @@ def search(pattern, code, flags=0):
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
)

0 comments on commit 3fa7f93

Please sign in to comment.