Skip to content

Commit

Permalink
Try giving sgp4_pure_python its own setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon-rhodes committed Feb 21, 2025
1 parent 9abaf9e commit 354e71e
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions pure_python/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
from distutils.core import setup

# Place this `setup.py` at the root of the project to build and
# distribute a pure-Python version of SGP4.

# Read the package's docstring and "__version__" without importing it.
path = 'sgp4/__init__.py'
with open(path, 'rb') as f:
text = f.read().decode('utf-8')
text = text.replace('-*- coding: utf-8 -*-', '') # for Python 2.7

namespace = {}
eval(compile(text, path, 'exec'), namespace)

version = namespace['__version__']
description, long_description = namespace['__doc__'].split('\n', 1)

# Avoid "`long_description` has syntax errors in markup" from extra
# whitespace that somehow creeps in.
description = description.strip()
long_description = """\
This distribution provides the `sgp4 package <https://pypi.org/project/sgp4/>`_
for computing Earth satellite positions, but without making any attempt to
compile and install the accelerated C++ version of the algorithm. Instead,
it is implemented in (rather slow) pure Python code.
"""

setup(
name = 'sgp4_pure_python',
version = version,
description = description,
long_description = long_description,
long_description_content_type = 'text/x-rst',
license = 'MIT',
author = 'Brandon Rhodes',
author_email = '[email protected]',
url = 'https://github.com/brandon-rhodes/python-sgp4',
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering :: Astronomy',
],
packages = ['sgp4'],
package_data = {'sgp4': ['SGP4-VER.TLE', 'sample*', 'tcppver.out']},
provides = ['sgp4'],
)

0 comments on commit 354e71e

Please sign in to comment.