From 5532344d473b3ccbcdff9a54f80084128431f341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Wed, 8 Nov 2017 17:01:25 +0100 Subject: [PATCH 1/6] Add simple development guide, hypothesis to testing requirements --- CONTRIBUTING.md | 18 ++++++++++++++++++ setup.py | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 CONTRIBUTING.md 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/setup.py b/setup.py index b30eb65..f7cd54c 100644 --- a/setup.py +++ b/setup.py @@ -22,4 +22,9 @@ install_requires=[ 'numpy', ], + extras_require={ + "dev": [ + "hypothesis", + ] + } ) From b702052fdb5fe7736d96b242bf6510d4afa9adcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Wed, 8 Nov 2017 17:09:47 +0100 Subject: [PATCH 2/6] Single source package version, comply with PEP 440 --- quaternions/__init__.py | 1 + quaternions/version.py | 2 ++ setup.py | 9 ++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 quaternions/version.py 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 f7cd54c..251a550 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,17 @@ #!/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', + 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.', From 2b0a206d8518278e55e5effe357d389c30d03a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Wed, 8 Nov 2017 17:15:20 +0100 Subject: [PATCH 3/6] Add .gitignore --- .gitignore | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .gitignore 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 From d8971447ab4c9ada6dca446d8d4510445e8cd6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Wed, 8 Nov 2017 17:20:29 +0100 Subject: [PATCH 4/6] Change project name to satellogic_quaternions Imports stay the same. --- README.md | 6 ++++++ setup.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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/setup.py b/setup.py index 251a550..9dcfb3e 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( - name='quaternions', + name='satellogic_quaternions', version=version["__version__"], author='Matias Graña', author_email='matias@satellogic.com', From 487e556f66bc0b780f7e79c6b094a1443280ca8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Wed, 8 Nov 2017 17:23:01 +0100 Subject: [PATCH 5/6] Fix setup.py classifiers --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9dcfb3e..d08616a 100644 --- a/setup.py +++ b/setup.py @@ -18,9 +18,9 @@ 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', From eb918b380b79e6af8e7d2f7734dbb992fa8e8dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Wed, 8 Nov 2017 17:43:33 +0100 Subject: [PATCH 6/6] Read long description from README Markdown support still pending, see https://github.com/pypa/warehouse/issues/869#issuecomment-340928703 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d08616a..0783ff1 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ 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=[