Skip to content

Commit

Permalink
Merge pull request #206 from ukBaz/setup_tidy_up
Browse files Browse the repository at this point in the history
setup.py support developer installs
  • Loading branch information
ukBaz authored Mar 3, 2019
2 parents f3d6659 + c0b0dfd commit 2512460
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 25 deletions.
7 changes: 4 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def __getattr__(cls, name):
'dbus.mainloop',
'dbus.mainloop.glib',
'gi.repository',
'aioblescan']
'aioblescan',
'aioblescan.plugins']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

sys.path.insert(0, os.path.abspath("../"))
Expand Down Expand Up @@ -72,9 +73,9 @@ def __getattr__(cls, name):
# built documents.
#
# The short X.Y version.
version = u'0.0.8'
version = u'0.1.0'
# The full version, including alpha/beta/rc tags.
release = u'0.0.8'
release = u'0.1.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
41 changes: 34 additions & 7 deletions docs/developer_docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,45 @@
Developer Documentation
=======================

Developer Install
=================

If you wish to help with the development of Bluezero then the recommended way
of installing for edit is as follows:

.. code-block:: none
git clone https://github.com/ukBaz/python-bluezero.git
cd python-bluezero
pip3 install -e .[dev]
Release Checklist
=================

* Check Travis-tests are passing
* Update version info in setup.py
* Build and publish PyPI package (see below)
* Check Travis-tests are passing (run_local_tests.sh)
* Update version info (see `Update Version Info`_)
* Build and publish PyPI package (see `Build PyPI package`_)
* Check PyPI page for obvious errors
* Update version in docs/conf.py (see below)
* ``git tag`` with version number
* Check read the docs page

Update Version Info
-------------------
Use bumpversion package to update all references at once.
This library tries to use `Semantic Versioning
<https://semver.org/#semantic-versioning-200>`_

Semantic version uses three numbers that represent ``major.minor.patch``.

The bumpversion command allows you to choose which to update. In the
following example the version is being updated for a patch.

.. code-block:: none
bumpversion patch setup.py
Build PyPI package
------------------

Expand All @@ -29,7 +57,8 @@ To upload to PyPI:
Test Build of Documentation
---------------------------

Update version information in docs/conf.py:
Do a test build of the documentation and then a visual inspection.
To do a local build of the documentation:

.. code-block:: none
Expand All @@ -39,5 +68,3 @@ Update version information in docs/conf.py:
* readthedocs gets update from GitHub
* readthedocs versions are based on GitHub version tags

.. include:: tests.rst
2 changes: 1 addition & 1 deletion docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Level 10
--------
- At this level the API will be pythonic.
- The API will require some knowledge of Bluetooth such as UUIDs of services and
characteristics for selecting required services.
characteristics for selecting required services.
- The API will not expose DBus terminology and will simplify event loops.

Level 100
Expand Down
15 changes: 11 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[bumpversion]
current_version = 0.1.0
tag = True
tag_name = {new_version}

[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and Python
# 3. If at all possible, it is good practice to do this. If you cannot, you
# will need to generate wheels for each Python version that you support.
universal=1
universal = 1

[bumpversion:file:setup.py]

[bumpversion:file:docs/conf.py]

29 changes: 19 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
"""

# Always prefer setuptools over distutils
from setuptools import setup, find_packages, setuptools
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

required_packages = ['aioblescan']
extras_rel = ['bumpversion', 'twine']
extras_doc = ['sphinx', 'sphinx_rtd_theme']
extras_test = ['coverage', 'pycodestyle']
extras_dev = extras_rel + extras_doc + extras_test

# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
Expand All @@ -23,10 +29,11 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.0.8',
version='0.1.0',

description='Python library for Bluetooth Low Energy (BLE) on Linux',
long_description=long_description,
long_description_content_type='text/x-rst',

# The project's main homepage.
url='https://github.com/ukBaz/python-bluezero',
Expand Down Expand Up @@ -69,9 +76,7 @@

# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
packages=find_packages(exclude=['contrib', 'docs', 'tests', 'examples',
'experiments', 'web_bluetooth']),
# packages=['bluezero'],
packages=['bluezero'],

# Alternatively, if you want to distribute just a my_module.py, uncomment
# this:
Expand All @@ -81,16 +86,20 @@
# your project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=['aioblescan'],
install_requires=required_packages,

# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
# for example:
# $ pip install -e .[dev,test]
# extras_require={
# 'dev': ['check-manifest'],
# 'test': ['pep8'],
# },
extras_require={
'rel': extras_rel,
'docs': extras_doc,
'test': extras_test,
'dev': extras_dev,
},

test_suite='tests',

# If there are data files included in your packages that need to be
# installed, specify them here. If using Python 2.6 or less, then these
Expand Down

0 comments on commit 2512460

Please sign in to comment.