Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
sblunt committed Jun 30, 2023
1 parent 1f80195 commit 3eefbce
Showing 1 changed file with 37 additions and 23 deletions.
60 changes: 37 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re

USE_C_KEPLER_MODULE = 1
if ("--disable-cython" in sys.argv):
if "--disable-cython" in sys.argv:
sys.argv.remove("--disable-cython")
USE_C_KEPLER_MODULE = 0
else:
Expand All @@ -13,44 +13,58 @@
print("Error: Importing cython build environment failed")
USE_C_KEPLER_MODULE = 0


# auto-updating version code stolen from RadVel
def get_property(prop, project):
result = re.search(r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop),
open(project + '/__init__.py').read())
result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop),
open(project + "/__init__.py").read(),
)
return result.group(1)


def get_requires():
reqs = []
for line in open('requirements.txt', 'r').readlines():
for line in open("requirements.txt", "r").readlines():
reqs.append(line)
return reqs


def get_extensions():
extensions = []
if(USE_C_KEPLER_MODULE):
extensions = cythonize([Extension("orbitize._kepler", ["orbitize/_kepler.pyx"], include_dirs=[numpy.get_include()])])
if USE_C_KEPLER_MODULE:
extensions = cythonize(
[
Extension(
"orbitize._kepler",
["orbitize/_kepler.pyx"],
include_dirs=[numpy.get_include()],
)
]
)
return extensions


setup(
name='orbitize',
version=get_property('__version__', 'orbitize'),
description='orbitize! Turns imaging data into orbits',
url='https://github.com/sblunt/orbitize',
author='',
author_email='',
license='BSD',
name="orbitize",
version=get_property("__version__", "orbitize"),
description="orbitize! Turns imaging data into orbits",
url="https://github.com/sblunt/orbitize",
author="",
author_email="",
license="BSD",
packages=find_packages(),
package_data={"":["kernels/*.cu"]},
package_data={"": ["kernels/*.cu"]},
ext_modules=get_extensions(),
include_dirs=[numpy.get_include()],
include_package_data = True,
include_package_data=True,
zip_safe=False,
classifiers=[
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Astronomy',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.6',
],
keywords='Orbits Astronomy Astrometry',
install_requires=get_requires()
)
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Astronomy",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
],
keywords="Orbits Astronomy Astrometry",
install_requires=get_requires(),
)

0 comments on commit 3eefbce

Please sign in to comment.