diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b3034f --- /dev/null +++ b/.gitignore @@ -0,0 +1,107 @@ + +# Created by https://www.gitignore.io/api/python + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# End of https://www.gitignore.io/api/python diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b271016 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# Setting up a development environment + +To install the code in development ("editable") mode inside a virtual environment: + +```bash +(myenv) $ cd quaternions +(myenv) $ pip install --editable .[dev] +``` + +This will install quaternions, its requirements and the testing dependencies. + +To run the tests: + +```bash +(myenv) $ python -m unittest discover tests/ +``` + +Or, alternatively, use `$ pytest`. diff --git a/README.md b/README.md index d937e5c..ad23a90 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,12 @@ Quaternions library This is a library for dealing with quaternions in python in a unified way. +To install it: + +```bash +$ pip install satellogic_quaternions +``` + Examples of code: ```python diff --git a/quaternions/__init__.py b/quaternions/__init__.py index 97b84a8..e1f0da1 100644 --- a/quaternions/__init__.py +++ b/quaternions/__init__.py @@ -1 +1,2 @@ from quaternions.quaternions import Quaternion, QuaternionError # NOQA +from quaternions.version import __version__ # NOQA diff --git a/quaternions/version.py b/quaternions/version.py new file mode 100644 index 0000000..2b720e5 --- /dev/null +++ b/quaternions/version.py @@ -0,0 +1,2 @@ +# https://www.python.org/dev/peps/pep-0440/ +__version__ = '0.1.3.dev0' diff --git a/setup.py b/setup.py index b30eb65..0783ff1 100644 --- a/setup.py +++ b/setup.py @@ -1,19 +1,27 @@ #!/usr/bin/env python3 +import os.path from setuptools import setup, find_packages +# https://packaging.python.org/guides/single-sourcing-package-version/ +version = {} +with open(os.path.join("quaternions", "version.py")) as fp: + exec(fp.read(), version) + + setup( - name='quaternions', - version='0.1.3', + name='satellogic_quaternions', + version=version["__version__"], author='Matias GraƱa', author_email='matias@satellogic.com', - long_description='This is a library for dealing with quaternions in python in a unified way.', + description='This is a library for dealing with quaternions in Python in a unified way.', + long_description=open('README.md').read(), packages=find_packages(exclude=["tests"]), license="GPLv3", classifiers=[ - 'Development Status :: 1 - Beta', + 'Development Status :: 4 - Beta', 'Environment :: Console', - 'Intended Audience :: Satellites', + 'Intended Audience :: Science/Research', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', @@ -22,4 +30,9 @@ install_requires=[ 'numpy', ], + extras_require={ + "dev": [ + "hypothesis", + ] + } )