-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
- Loading branch information
Showing
2 changed files
with
40 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,38 @@ | ||
[metadata] | ||
name=pypowsybl | ||
version = attr: pypowsybl.__version__ | ||
author=Geoffroy Jamgotchian | ||
author_email[email protected] | ||
description=A PowSyBl Python API | ||
long_description=file: README.md | ||
long_description_content_type=text/markdown | ||
url=https://github.com/powsybl/pypowsybl | ||
classifiers = | ||
Development Status :: 4 - Beta | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
Programming Language :: Python :: 3.11 | ||
Programming Language :: Python :: Implementation :: CPython | ||
License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0) | ||
Operating System :: POSIX :: Linux | ||
Operating System :: MacOS | ||
Operating System :: Microsoft :: Windows | ||
|
||
[options] | ||
zip_safe = False | ||
include_package_data = True | ||
packages = find: | ||
python_requires = >=3.7 | ||
install_requires = | ||
prettytable | ||
numpy>=1.20.0 | ||
pandas>=1.4.4; sys_platform == "darwin" and platform_machine == "arm64" | ||
pandas>=1.3.5; sys_platform != "darwin" or platform_machine != "arm64" | ||
networkx | ||
|
||
[options.package_data] | ||
pypowsybl: py.typed, *.pyi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,9 @@ | |
import platform | ||
import subprocess | ||
|
||
from setuptools import setup, find_packages, Extension | ||
from setuptools import setup, Extension | ||
from setuptools.command.build_ext import build_ext | ||
from distutils.version import LooseVersion | ||
|
||
from packaging.version import parse | ||
|
||
class PyPowsyblExtension(Extension): | ||
def __init__(self): | ||
|
@@ -30,8 +29,8 @@ def run(self): | |
", ".join(e.name for e in self.extensions)) | ||
|
||
if platform.system() == "Windows": | ||
cmake_version = LooseVersion(re.search(r'version\s*([\d.]+)', out.decode()).group(1)) | ||
if cmake_version < '3.1.0': | ||
cmake_version = parse(re.search(r'version\s*([\d.]+)', out.decode()).group(1)) | ||
if cmake_version < parse('3.1.0'): | ||
raise RuntimeError("CMake >= 3.1.0 is required on Windows") | ||
|
||
for ext in self.extensions: | ||
|
@@ -68,47 +67,7 @@ def build_extension(self, ext): | |
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp) | ||
|
||
|
||
# long description from the github readme | ||
with open("README.md", "r", encoding="utf-8") as fh: | ||
long_description = fh.read() | ||
|
||
setup( | ||
name='pypowsybl', | ||
author='Geoffroy Jamgotchian', | ||
author_email="[email protected]", | ||
description='A PowSyBl Python API', | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/powsybl/pypowsybl", | ||
packages=find_packages(), | ||
include_package_data=True, | ||
package_data={ | ||
'pypowsybl': ['py.typed', '*.pyi'] | ||
}, | ||
ext_modules=[PyPowsyblExtension()], | ||
cmdclass=dict(build_ext=PyPowsyblBuild), | ||
zip_safe=False, | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", | ||
"Operating System :: POSIX :: Linux", | ||
"Operating System :: MacOS", | ||
"Operating System :: Microsoft :: Windows", | ||
], | ||
python_requires='>=3.7', | ||
install_requires=[ | ||
'prettytable', | ||
'numpy>=1.20.0', | ||
'pandas>=1.4.4; sys_platform == "darwin" and platform_machine == "arm64"', | ||
'pandas>=1.3.5; sys_platform != "darwin" or platform_machine != "arm64"', | ||
'networkx' | ||
], | ||
) |