Compare commits
29 commits
lowercase_
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
974d5e6656 | ||
|
|
0d49a1fcd9 | ||
|
|
0e32efa93d | ||
|
|
b08aa012dd | ||
|
|
e2d5a2f4cd | ||
|
|
ab1f24811b | ||
|
|
19712a748f | ||
|
|
d9822e6690 | ||
|
|
220ddc70d8 | ||
|
|
256dc1c0e5 | ||
|
|
42024d0f8c | ||
|
|
2e6caa7c1e | ||
|
|
c0f88087fa | ||
|
|
6a299d88e0 | ||
|
|
dc1d8dd99c | ||
|
|
d2c3788821 | ||
|
|
1bf2707c91 | ||
|
|
65c458da1a | ||
|
|
82d250586d | ||
|
|
4e90dcadb4 | ||
|
|
ed71b40dc9 | ||
|
|
c2462e72a9 | ||
|
|
db8dfb4289 | ||
|
|
395ddb7682 | ||
|
|
df2037bddd | ||
|
|
5e953fcb26 | ||
|
|
0e8b9ae9bd | ||
|
|
dab1a53569 | ||
|
|
de9017c73e |
11 changed files with 308 additions and 201 deletions
57
.github/workflows/build.yml
vendored
Normal file
57
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
name: Build CI
|
||||||
|
|
||||||
|
on: [pull_request, push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Dump GitHub context
|
||||||
|
env:
|
||||||
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
|
run: echo "$GITHUB_CONTEXT"
|
||||||
|
- name: Translate Repo Name For Build Tools filename_prefix
|
||||||
|
id: repo-name
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=repo-name::$(
|
||||||
|
echo ${{ github.repository }} |
|
||||||
|
awk -F '\/' '{ print tolower($2) }' |
|
||||||
|
tr '_' '-'
|
||||||
|
)
|
||||||
|
- name: Set up Python 3.6
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.6
|
||||||
|
- name: Versions
|
||||||
|
run: |
|
||||||
|
python3 --version
|
||||||
|
- name: Checkout Current Repo
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Checkout tools repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: adafruit/actions-ci-circuitpython-libs
|
||||||
|
path: actions-ci
|
||||||
|
- name: Install dependencies
|
||||||
|
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
|
||||||
|
run: |
|
||||||
|
source actions-ci/install.sh
|
||||||
|
- name: Pip install pylint, black, & Sphinx
|
||||||
|
run: |
|
||||||
|
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
|
||||||
|
- name: Library version
|
||||||
|
run: git describe --dirty --always --tags
|
||||||
|
- name: Check formatting
|
||||||
|
run: |
|
||||||
|
black --check --target-version=py35 .
|
||||||
|
- name: PyLint
|
||||||
|
run: |
|
||||||
|
pylint $( find . -path './adafruit*.py' )
|
||||||
|
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
|
||||||
|
- name: Build assets
|
||||||
|
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
|
||||||
|
- name: Build docs
|
||||||
|
working-directory: docs
|
||||||
|
run: sphinx-build -E -W -b html . _build/html
|
||||||
81
.github/workflows/release.yml
vendored
Normal file
81
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
name: Release Actions
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
upload-release-assets:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Dump GitHub context
|
||||||
|
env:
|
||||||
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
|
run: echo "$GITHUB_CONTEXT"
|
||||||
|
- name: Translate Repo Name For Build Tools filename_prefix
|
||||||
|
id: repo-name
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=repo-name::$(
|
||||||
|
echo ${{ github.repository }} |
|
||||||
|
awk -F '\/' '{ print tolower($2) }' |
|
||||||
|
tr '_' '-'
|
||||||
|
)
|
||||||
|
- name: Set up Python 3.6
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.6
|
||||||
|
- name: Versions
|
||||||
|
run: |
|
||||||
|
python3 --version
|
||||||
|
- name: Checkout Current Repo
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Checkout tools repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: adafruit/actions-ci-circuitpython-libs
|
||||||
|
path: actions-ci
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
source actions-ci/install.sh
|
||||||
|
- name: Build assets
|
||||||
|
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
|
||||||
|
- name: Upload Release Assets
|
||||||
|
# the 'official' actions version does not yet support dynamically
|
||||||
|
# supplying asset names to upload. @csexton's version chosen based on
|
||||||
|
# discussion in the issue below, as its the simplest to implement and
|
||||||
|
# allows for selecting files with a pattern.
|
||||||
|
# https://github.com/actions/upload-release-asset/issues/4
|
||||||
|
#uses: actions/upload-release-asset@v1.0.1
|
||||||
|
uses: csexton/release-asset-action@master
|
||||||
|
with:
|
||||||
|
pattern: "bundles/*"
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
upload-pypi:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Check For setup.py
|
||||||
|
id: need-pypi
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
||||||
|
- name: Set up Python
|
||||||
|
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
- name: Install dependencies
|
||||||
|
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install setuptools wheel twine
|
||||||
|
- name: Build and publish
|
||||||
|
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||||
|
env:
|
||||||
|
TWINE_USERNAME: ${{ secrets.pypi_username }}
|
||||||
|
TWINE_PASSWORD: ${{ secrets.pypi_password }}
|
||||||
|
run: |
|
||||||
|
python setup.py sdist
|
||||||
|
twine upload dist/*
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -4,7 +4,6 @@ __pycache__
|
||||||
_build
|
_build
|
||||||
*.pyc
|
*.pyc
|
||||||
.env
|
.env
|
||||||
build*
|
|
||||||
bundles
|
bundles
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
.eggs
|
.eggs
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ confidence=
|
||||||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||||
# --disable=W"
|
# --disable=W"
|
||||||
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
|
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
|
||||||
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error
|
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation
|
||||||
|
|
||||||
# Enable the message, report, category or checker with the given id(s). You can
|
# Enable the message, report, category or checker with the given id(s). You can
|
||||||
# either give multiple identifier separated by comma (,) or put this option
|
# either give multiple identifier separated by comma (,) or put this option
|
||||||
|
|
@ -119,7 +119,8 @@ spelling-store-unknown-words=no
|
||||||
[MISCELLANEOUS]
|
[MISCELLANEOUS]
|
||||||
|
|
||||||
# List of note tags to take in consideration, separated by a comma.
|
# List of note tags to take in consideration, separated by a comma.
|
||||||
notes=FIXME,XXX,TODO
|
# notes=FIXME,XXX,TODO
|
||||||
|
notes=FIXME,XXX
|
||||||
|
|
||||||
|
|
||||||
[TYPECHECK]
|
[TYPECHECK]
|
||||||
|
|
@ -300,7 +301,7 @@ function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
# Good variable names which should always be accepted, separated by a comma
|
# Good variable names which should always be accepted, separated by a comma
|
||||||
# good-names=i,j,k,ex,Run,_
|
# good-names=i,j,k,ex,Run,_
|
||||||
good-names=r,g,b,i,j,k,n,ex,Run,_
|
good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_
|
||||||
|
|
||||||
# Include a hint for the correct naming format with invalid-name
|
# Include a hint for the correct naming format with invalid-name
|
||||||
include-naming-hint=no
|
include-naming-hint=no
|
||||||
|
|
@ -422,7 +423,7 @@ max-returns=6
|
||||||
max-statements=50
|
max-statements=50
|
||||||
|
|
||||||
# Minimum number of public methods for a class (see R0903).
|
# Minimum number of public methods for a class (see R0903).
|
||||||
min-public-methods=2
|
min-public-methods=1
|
||||||
|
|
||||||
|
|
||||||
[EXCEPTIONS]
|
[EXCEPTIONS]
|
||||||
|
|
|
||||||
32
.travis.yml
32
.travis.yml
|
|
@ -1,32 +0,0 @@
|
||||||
dist: trusty
|
|
||||||
sudo: false
|
|
||||||
language: python
|
|
||||||
python:
|
|
||||||
- '3.6'
|
|
||||||
cache:
|
|
||||||
pip: true
|
|
||||||
deploy:
|
|
||||||
- provider: releases
|
|
||||||
api_key: "$GITHUB_TOKEN"
|
|
||||||
file_glob: true
|
|
||||||
file: "$TRAVIS_BUILD_DIR/bundles/*"
|
|
||||||
skip_cleanup: true
|
|
||||||
overwrite: true
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
- provider: pypi
|
|
||||||
user: adafruit-travis
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
password:
|
|
||||||
secure: apWQJCBG0Ac5t0zXV6zLmcsYiZK42Vf8gA7dgQXwYxeQp7V+Tmfn3/F5C5mH1POfY8uiHDCDnwk0vqqpmF9jNaoJ5BG4sVh2v5CifAlE+qb+jt9GsjBjq8vlhnjOKIMdw0r64qiWMrnM2zMTcmeDQlERmdb0C/5Rbq36+azPR/zUu4P8pnk/uuJelWu68SnrSeOT7GqosEN/mloyJEesu20e8taLSzYQNZ77yx+tNzPRHhxinbIx6pXp4H2jAj5euhOyRjYZb9Qm7PswyKeKcOQLM7zcPXDN4Dwo1CMITGUuITJTk8iRXW13uXQScAEdrf1PN3rWqHc+AjgiNGYFlP7+GB69xrUe5M1AQKbCiAv/cirQ5lkkdqzYGP9TVG1yGHaf5QvVI68c0NZxy2JGpeKOXAo/YwpX61KeJGfRkFwMD3uaYnRHfCWkyIhXQKwygHhGbcOAZh+xnGpA/0Z87bqkh6Wwq9+JxsO6hfkJVPUccEey/c98ilPHzXdBSdUDGdsKQWMV+HjMJx2Nes8P0ObDMdLJz15RG80YimYpphuYSRhQEx6rACgnUS426Ax8ir94hUruBHzqz3ZzJEJ4YoLdEFbIXVqB3aAY4uBykTdm4rsa1M+JcBHmT/n6Kt/HfbN37Qxg0nHMGSXTrOWAsZHU6t9Vq7Xv+wUUWYdashc=
|
|
||||||
install:
|
|
||||||
- pip install -r requirements.txt
|
|
||||||
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
|
|
||||||
- pip install --force-reinstall pylint==1.9.2
|
|
||||||
script:
|
|
||||||
- pylint adafruit_ds3231.py
|
|
||||||
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py)
|
|
||||||
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-ds3231 --library_location
|
|
||||||
.
|
|
||||||
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..
|
|
||||||
|
|
@ -34,13 +34,15 @@ Examples of unacceptable behavior by participants include:
|
||||||
* Excessive or unwelcome helping; answering outside the scope of the question
|
* Excessive or unwelcome helping; answering outside the scope of the question
|
||||||
asked
|
asked
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Promoting or spreading disinformation, lies, or conspiracy theories against
|
||||||
|
a person, group, organisation, project, or community
|
||||||
* Public or private harassment
|
* Public or private harassment
|
||||||
* Publishing others' private information, such as a physical or electronic
|
* Publishing others' private information, such as a physical or electronic
|
||||||
address, without explicit permission
|
address, without explicit permission
|
||||||
* Other conduct which could reasonably be considered inappropriate
|
* Other conduct which could reasonably be considered inappropriate
|
||||||
|
|
||||||
The goal of the standards and moderation guidelines outlined here is to build
|
The goal of the standards and moderation guidelines outlined here is to build
|
||||||
and maintain a respectful community. We ask that you don’t just aim to be
|
and maintain a respectful community. We ask that you don’t just aim to be
|
||||||
"technically unimpeachable", but rather try to be your best self.
|
"technically unimpeachable", but rather try to be your best self.
|
||||||
|
|
||||||
We value many things beyond technical expertise, including collaboration and
|
We value many things beyond technical expertise, including collaboration and
|
||||||
|
|
@ -72,10 +74,10 @@ You may report in the following ways:
|
||||||
In any situation, you may send an email to <support@adafruit.com>.
|
In any situation, you may send an email to <support@adafruit.com>.
|
||||||
|
|
||||||
On the Adafruit Discord, you may send an open message from any channel
|
On the Adafruit Discord, you may send an open message from any channel
|
||||||
to all Community Helpers by tagging @community helpers. You may also send an
|
to all Community Moderators by tagging @community moderators. You may
|
||||||
open message from any channel, or a direct message to @kattni#1507,
|
also send an open message from any channel, or a direct message to
|
||||||
@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or
|
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
|
||||||
@Andon#8175.
|
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
|
||||||
|
|
||||||
Email and direct message reports will be kept confidential.
|
Email and direct message reports will be kept confidential.
|
||||||
|
|
||||||
|
|
@ -83,7 +85,7 @@ In situations on Discord where the issue is particularly egregious, possibly
|
||||||
illegal, requires immediate action, or violates the Discord terms of service,
|
illegal, requires immediate action, or violates the Discord terms of service,
|
||||||
you should also report the message directly to Discord.
|
you should also report the message directly to Discord.
|
||||||
|
|
||||||
These are the steps for upholding our community’s standards of conduct.
|
These are the steps for upholding our community’s standards of conduct.
|
||||||
|
|
||||||
1. Any member of the community may report any situation that violates the
|
1. Any member of the community may report any situation that violates the
|
||||||
Adafruit Community Code of Conduct. All reports will be reviewed and
|
Adafruit Community Code of Conduct. All reports will be reviewed and
|
||||||
|
|
|
||||||
83
README.rst
83
README.rst
|
|
@ -1,16 +1,16 @@
|
||||||
Introduction
|
Introduction
|
||||||
============
|
=============
|
||||||
|
|
||||||
.. image:: https://readthedocs.org/projects/adafruit-micropython-ds3231/badge/?version=latest
|
.. image:: https://readthedocs.org/projects/adafruit-micropython-ds3231/badge/?version=latest
|
||||||
:target: https://circuitpython.readthedocs.io/projects/ds3231/en/latest/
|
:target: https://circuitpython.readthedocs.io/projects/ds3231/en/latest/
|
||||||
:alt: Documentation Status
|
:alt: Documentation Status
|
||||||
|
|
||||||
.. image :: https://img.shields.io/discord/327254708534116352.svg
|
.. image :: https://img.shields.io/discord/327254708534116352.svg
|
||||||
:target: https://discord.gg/nBQh6qu
|
:target: https://adafru.it/discord
|
||||||
:alt: Discord
|
:alt: Discord
|
||||||
|
|
||||||
.. image:: https://travis-ci.org/adafruit/Adafruit_CircuitPython_DS3231.svg?branch=master
|
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_DS3231/workflows/Build%20CI/badge.svg
|
||||||
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_DS3231
|
:target: https://github.com/adafruit/Adafruit_CircuitPython_DS3231/actions/
|
||||||
:alt: Build Status
|
:alt: Build Status
|
||||||
|
|
||||||
The datasheet for the DS3231 explains that this part is an
|
The datasheet for the DS3231 explains that this part is an
|
||||||
|
|
@ -52,6 +52,31 @@ Please ensure all dependencies are available on the CircuitPython filesystem.
|
||||||
This is easily achieved by downloading
|
This is easily achieved by downloading
|
||||||
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
|
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
|
||||||
|
|
||||||
|
Installing from PyPI
|
||||||
|
====================
|
||||||
|
|
||||||
|
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
|
||||||
|
PyPI <https://pypi.org/project/adafruit-circuitpython-ds3231/>`_. To install for current user:
|
||||||
|
|
||||||
|
.. code-block:: shell
|
||||||
|
|
||||||
|
pip3 install adafruit-circuitpython-ds3231
|
||||||
|
|
||||||
|
To install system-wide (this may be required in some cases):
|
||||||
|
|
||||||
|
.. code-block:: shell
|
||||||
|
|
||||||
|
sudo pip3 install adafruit-circuitpython-ds3231
|
||||||
|
|
||||||
|
To install in a virtual environment in your current project:
|
||||||
|
|
||||||
|
.. code-block:: shell
|
||||||
|
|
||||||
|
mkdir project-name && cd project-name
|
||||||
|
python3 -m venv .env
|
||||||
|
source .env/bin/activate
|
||||||
|
pip3 install adafruit-circuitpython-ds3231
|
||||||
|
|
||||||
Usage Notes
|
Usage Notes
|
||||||
===========
|
===========
|
||||||
|
|
||||||
|
|
@ -137,49 +162,7 @@ Contributions are welcome! Please read our `Code of Conduct
|
||||||
<https://github.com/adafruit/Adafruit_CircuitPython_DS3231/blob/master/CODE_OF_CONDUCT.md>`_
|
<https://github.com/adafruit/Adafruit_CircuitPython_DS3231/blob/master/CODE_OF_CONDUCT.md>`_
|
||||||
before contributing to help this project stay welcoming.
|
before contributing to help this project stay welcoming.
|
||||||
|
|
||||||
Building locally
|
Documentation
|
||||||
================
|
=============
|
||||||
|
|
||||||
To build this library locally you'll need to install the
|
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
|
||||||
`circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package.
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
python3 -m venv .env
|
|
||||||
source .env/bin/activate
|
|
||||||
pip install circuitpython-build-tools
|
|
||||||
|
|
||||||
Once installed, make sure you are in the virtual environment:
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
source .env/bin/activate
|
|
||||||
|
|
||||||
Then run the build:
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-ds3231 --library_location .
|
|
||||||
|
|
||||||
Sphinx documentation
|
|
||||||
-----------------------
|
|
||||||
|
|
||||||
Sphinx is used to build the documentation based on rST files and comments in the code. First,
|
|
||||||
install dependencies (feel free to reuse the virtual environment from above):
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
python3 -m venv .env
|
|
||||||
source .env/bin/activate
|
|
||||||
pip install Sphinx sphinx-rtd-theme
|
|
||||||
|
|
||||||
Now, once you have the virtual environment activated:
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
cd docs
|
|
||||||
sphinx-build -E -W -b html . _build/html
|
|
||||||
|
|
||||||
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
|
|
||||||
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
|
|
||||||
locally verify it will pass.
|
|
||||||
|
|
|
||||||
|
|
@ -66,10 +66,10 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DS3231.git"
|
||||||
class DS3231:
|
class DS3231:
|
||||||
"""Interface to the DS3231 RTC."""
|
"""Interface to the DS3231 RTC."""
|
||||||
|
|
||||||
lost_power = i2c_bit.RWBit(0x0f, 7)
|
lost_power = i2c_bit.RWBit(0x0F, 7)
|
||||||
"""True if the device has lost power since the time was set."""
|
"""True if the device has lost power since the time was set."""
|
||||||
|
|
||||||
disable_oscillator = i2c_bit.RWBit(0x0e, 7)
|
disable_oscillator = i2c_bit.RWBit(0x0E, 7)
|
||||||
"""True if the oscillator is disabled."""
|
"""True if the oscillator is disabled."""
|
||||||
|
|
||||||
datetime_register = i2c_bcd_datetime.BCDDateTimeRegister(0x00)
|
datetime_register = i2c_bcd_datetime.BCDDateTimeRegister(0x00)
|
||||||
|
|
@ -78,35 +78,24 @@ class DS3231:
|
||||||
alarm1 = i2c_bcd_alarm.BCDAlarmTimeRegister(0x07)
|
alarm1 = i2c_bcd_alarm.BCDAlarmTimeRegister(0x07)
|
||||||
"""Alarm time for the first alarm."""
|
"""Alarm time for the first alarm."""
|
||||||
|
|
||||||
alarm1_interrupt = i2c_bit.RWBit(0x0e, 0)
|
alarm1_interrupt = i2c_bit.RWBit(0x0E, 0)
|
||||||
"""True if the interrupt pin will output when alarm1 is alarming."""
|
"""True if the interrupt pin will output when alarm1 is alarming."""
|
||||||
|
|
||||||
alarm1_status = i2c_bit.RWBit(0x0f, 0)
|
alarm1_status = i2c_bit.RWBit(0x0F, 0)
|
||||||
"""True if alarm1 is alarming. Set to False to reset."""
|
"""True if alarm1 is alarming. Set to False to reset."""
|
||||||
|
|
||||||
alarm2 = i2c_bcd_alarm.BCDAlarmTimeRegister(0x0b, has_seconds=False)
|
alarm2 = i2c_bcd_alarm.BCDAlarmTimeRegister(0x0B, has_seconds=False)
|
||||||
"""Alarm time for the second alarm."""
|
"""Alarm time for the second alarm."""
|
||||||
|
|
||||||
alarm2_interrupt = i2c_bit.RWBit(0x0e, 1)
|
alarm2_interrupt = i2c_bit.RWBit(0x0E, 1)
|
||||||
"""True if the interrupt pin will output when alarm2 is alarming."""
|
"""True if the interrupt pin will output when alarm2 is alarming."""
|
||||||
|
|
||||||
alarm2_status = i2c_bit.RWBit(0x0f, 1)
|
alarm2_status = i2c_bit.RWBit(0x0F, 1)
|
||||||
"""True if alarm2 is alarming. Set to False to reset."""
|
"""True if alarm2 is alarming. Set to False to reset."""
|
||||||
|
|
||||||
def __init__(self, i2c):
|
def __init__(self, i2c):
|
||||||
self.i2c_device = I2CDevice(i2c, 0x68)
|
self.i2c_device = I2CDevice(i2c, 0x68)
|
||||||
|
|
||||||
# Try and verify this is the RTC we expect by checking the rate select
|
|
||||||
# control bits which are 1 on reset and shouldn't ever be changed.
|
|
||||||
buf = bytearray(2)
|
|
||||||
buf[0] = 0x0e
|
|
||||||
with self.i2c_device as i2c_device:
|
|
||||||
i2c_device.write(buf, end=1, stop=False)
|
|
||||||
i2c_device.readinto(buf, start=1)
|
|
||||||
|
|
||||||
if (buf[1] & 0b00011000) != 0b00011000:
|
|
||||||
raise ValueError("Unable to find DS3231 at i2c address 0x68.")
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def datetime(self):
|
def datetime(self):
|
||||||
"""Gets the current date and time or sets the current date and time
|
"""Gets the current date and time or sets the current date and time
|
||||||
|
|
|
||||||
96
docs/conf.py
96
docs/conf.py
|
|
@ -18,7 +18,8 @@
|
||||||
#
|
#
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
sys.path.insert(0, os.path.abspath('..'))
|
|
||||||
|
sys.path.insert(0, os.path.abspath(".."))
|
||||||
|
|
||||||
# -- General configuration ------------------------------------------------
|
# -- General configuration ------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -30,10 +31,10 @@ sys.path.insert(0, os.path.abspath('..'))
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
# ones.
|
# ones.
|
||||||
extensions = [
|
extensions = [
|
||||||
'sphinx.ext.autodoc',
|
"sphinx.ext.autodoc",
|
||||||
'sphinx.ext.todo',
|
"sphinx.ext.todo",
|
||||||
'sphinx.ext.viewcode',
|
"sphinx.ext.viewcode",
|
||||||
'sphinx.ext.intersphinx'
|
"sphinx.ext.intersphinx",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Uncomment the below if you use native CircuitPython modules such as
|
# Uncomment the below if you use native CircuitPython modules such as
|
||||||
|
|
@ -41,15 +42,26 @@ extensions = [
|
||||||
# autodoc module docs will fail to generate with a warning.
|
# autodoc module docs will fail to generate with a warning.
|
||||||
# autodoc_mock_imports = ["adafruit_bus_device", "adafruit_register"]
|
# autodoc_mock_imports = ["adafruit_bus_device", "adafruit_register"]
|
||||||
|
|
||||||
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),'Register': ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
|
intersphinx_mapping = {
|
||||||
|
"python": ("https://docs.python.org/3.4", None),
|
||||||
|
"BusDevice": (
|
||||||
|
"https://circuitpython.readthedocs.io/projects/busdevice/en/latest/",
|
||||||
|
None,
|
||||||
|
),
|
||||||
|
"Register": (
|
||||||
|
"https://circuitpython.readthedocs.io/projects/register/en/latest/",
|
||||||
|
None,
|
||||||
|
),
|
||||||
|
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
|
||||||
|
}
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ['_templates']
|
templates_path = ["_templates"]
|
||||||
|
|
||||||
# The suffix(es) of source filenames.
|
# The suffix(es) of source filenames.
|
||||||
# You can specify multiple suffix as a list of string:
|
# You can specify multiple suffix as a list of string:
|
||||||
#
|
#
|
||||||
source_suffix = ['.rst', '.md']
|
source_suffix = [".rst", ".md"]
|
||||||
# source_suffix = '.rst'
|
# source_suffix = '.rst'
|
||||||
|
|
||||||
# The encoding of source files.
|
# The encoding of source files.
|
||||||
|
|
@ -57,21 +69,21 @@ source_suffix = ['.rst', '.md']
|
||||||
# source_encoding = 'utf-8-sig'
|
# source_encoding = 'utf-8-sig'
|
||||||
|
|
||||||
# The master toctree document.
|
# The master toctree document.
|
||||||
master_doc = 'index'
|
master_doc = "index"
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'Adafruit\'s DS3231 RTC Library'
|
project = "Adafruit's DS3231 RTC Library"
|
||||||
copyright = u'2016, Philip Moyer'
|
copyright = "2016, Philip Moyer"
|
||||||
author = u'Philip Moyer'
|
author = "Philip Moyer"
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = u'1.0'
|
version = "1.0"
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = u'1.0'
|
release = "1.0"
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
|
@ -92,7 +104,7 @@ language = None
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
# This patterns also effect to html_static_path and html_extra_path
|
# This patterns also effect to html_static_path and html_extra_path
|
||||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
|
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all
|
# The reST default role (used for this markup: `text`) to use for all
|
||||||
# documents.
|
# documents.
|
||||||
|
|
@ -114,7 +126,7 @@ add_function_parentheses = True
|
||||||
# show_authors = False
|
# show_authors = False
|
||||||
|
|
||||||
# The name of the Pygments (syntax highlighting) style to use.
|
# The name of the Pygments (syntax highlighting) style to use.
|
||||||
pygments_style = 'sphinx'
|
pygments_style = "sphinx"
|
||||||
|
|
||||||
# A list of ignored prefixes for module index sorting.
|
# A list of ignored prefixes for module index sorting.
|
||||||
# modindex_common_prefix = []
|
# modindex_common_prefix = []
|
||||||
|
|
@ -134,18 +146,19 @@ todo_emit_warnings = True
|
||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
# a list of builtin themes.
|
# a list of builtin themes.
|
||||||
#
|
#
|
||||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
|
||||||
|
|
||||||
if not on_rtd: # only import and set the theme if we're building docs locally
|
if not on_rtd: # only import and set the theme if we're building docs locally
|
||||||
try:
|
try:
|
||||||
import sphinx_rtd_theme
|
import sphinx_rtd_theme
|
||||||
html_theme = 'sphinx_rtd_theme'
|
|
||||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
|
html_theme = "sphinx_rtd_theme"
|
||||||
|
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
|
||||||
except:
|
except:
|
||||||
html_theme = 'default'
|
html_theme = "default"
|
||||||
html_theme_path = ['.']
|
html_theme_path = ["."]
|
||||||
else:
|
else:
|
||||||
html_theme_path = ['.']
|
html_theme_path = ["."]
|
||||||
|
|
||||||
# Theme options are theme-specific and customize the look and feel of a theme
|
# Theme options are theme-specific and customize the look and feel of a theme
|
||||||
# further. For a list of options available for each theme, see the
|
# further. For a list of options available for each theme, see the
|
||||||
|
|
@ -179,13 +192,13 @@ else:
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
html_static_path = ["_static"]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to use as a favicon of
|
# The name of an image file (relative to this directory) to use as a favicon of
|
||||||
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||||
# pixels large.
|
# pixels large.
|
||||||
#
|
#
|
||||||
html_favicon = '_static/favicon.ico'
|
html_favicon = "_static/favicon.ico"
|
||||||
|
|
||||||
# Add any extra paths that contain custom files (such as robots.txt or
|
# Add any extra paths that contain custom files (such as robots.txt or
|
||||||
# .htaccess) here, relative to this directory. These files are copied
|
# .htaccess) here, relative to this directory. These files are copied
|
||||||
|
|
@ -265,7 +278,7 @@ html_favicon = '_static/favicon.ico'
|
||||||
# html_search_scorer = 'scorer.js'
|
# html_search_scorer = 'scorer.js'
|
||||||
|
|
||||||
# Output file base name for HTML help builder.
|
# Output file base name for HTML help builder.
|
||||||
htmlhelp_basename = 'AdafruitsDS3231RTCLibrarydoc'
|
htmlhelp_basename = "AdafruitsDS3231RTCLibrarydoc"
|
||||||
|
|
||||||
# -- Options for LaTeX output ---------------------------------------------
|
# -- Options for LaTeX output ---------------------------------------------
|
||||||
|
|
||||||
|
|
@ -273,15 +286,12 @@ latex_elements = {
|
||||||
# The paper size ('letterpaper' or 'a4paper').
|
# The paper size ('letterpaper' or 'a4paper').
|
||||||
#
|
#
|
||||||
# 'papersize': 'letterpaper',
|
# 'papersize': 'letterpaper',
|
||||||
|
|
||||||
# The font size ('10pt', '11pt' or '12pt').
|
# The font size ('10pt', '11pt' or '12pt').
|
||||||
#
|
#
|
||||||
# 'pointsize': '10pt',
|
# 'pointsize': '10pt',
|
||||||
|
|
||||||
# Additional stuff for the LaTeX preamble.
|
# Additional stuff for the LaTeX preamble.
|
||||||
#
|
#
|
||||||
# 'preamble': '',
|
# 'preamble': '',
|
||||||
|
|
||||||
# Latex figure (float) alignment
|
# Latex figure (float) alignment
|
||||||
#
|
#
|
||||||
# 'figure_align': 'htbp',
|
# 'figure_align': 'htbp',
|
||||||
|
|
@ -291,8 +301,13 @@ latex_elements = {
|
||||||
# (source start file, target name, title,
|
# (source start file, target name, title,
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
(master_doc, 'AdafruitsDS3231RTCLibrary.tex', u'Adafruit\'s DS3231 RTC Library Documentation',
|
(
|
||||||
u'Philip Moyer', 'manual'),
|
master_doc,
|
||||||
|
"AdafruitsDS3231RTCLibrary.tex",
|
||||||
|
"Adafruit's DS3231 RTC Library Documentation",
|
||||||
|
"Philip Moyer",
|
||||||
|
"manual",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
|
|
@ -333,8 +348,13 @@ latex_documents = [
|
||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
(master_doc, 'adafruitsds3231rtclibrary', u'Adafruit\'s DS3231 RTC Library Documentation',
|
(
|
||||||
[author], 1)
|
master_doc,
|
||||||
|
"adafruitsds3231rtclibrary",
|
||||||
|
"Adafruit's DS3231 RTC Library Documentation",
|
||||||
|
[author],
|
||||||
|
1,
|
||||||
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
# If true, show URL addresses after external links.
|
||||||
|
|
@ -348,9 +368,15 @@ man_pages = [
|
||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
(master_doc, 'AdafruitsDS3231RTCLibrary', u'Adafruit\'s DS3231 RTC Library Documentation',
|
(
|
||||||
author, 'AdafruitsDS3231RTCLibrary', 'One line description of project.',
|
master_doc,
|
||||||
'Miscellaneous'),
|
"AdafruitsDS3231RTCLibrary",
|
||||||
|
"Adafruit's DS3231 RTC Library Documentation",
|
||||||
|
author,
|
||||||
|
"AdafruitsDS3231RTCLibrary",
|
||||||
|
"One line description of project.",
|
||||||
|
"Miscellaneous",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
# Documents to append as an appendix to all manuals.
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import board
|
import board
|
||||||
|
|
||||||
# For hardware I2C (M0 boards) use this line:
|
# For hardware I2C (M0 boards) use this line:
|
||||||
import busio as io
|
import busio as io
|
||||||
|
|
||||||
# Or for software I2C (ESP8266) use this line instead:
|
# Or for software I2C (ESP8266) use this line instead:
|
||||||
# import bitbangio as io
|
# import bitbangio as io
|
||||||
|
|
||||||
|
|
@ -40,6 +42,10 @@ if False: # change to True if you want to set the time!
|
||||||
while True:
|
while True:
|
||||||
t = rtc.datetime
|
t = rtc.datetime
|
||||||
# print(t) # uncomment for debugging
|
# print(t) # uncomment for debugging
|
||||||
print("The date is {} {}/{}/{}".format(days[int(t.tm_wday)], t.tm_mday, t.tm_mon, t.tm_year))
|
print(
|
||||||
|
"The date is {} {}/{}/{}".format(
|
||||||
|
days[int(t.tm_wday)], t.tm_mday, t.tm_mon, t.tm_year
|
||||||
|
)
|
||||||
|
)
|
||||||
print("The time is {}:{:02}:{:02}".format(t.tm_hour, t.tm_min, t.tm_sec))
|
print("The time is {}:{:02}:{:02}".format(t.tm_hour, t.tm_min, t.tm_sec))
|
||||||
time.sleep(1) # wait a second
|
time.sleep(1) # wait a second
|
||||||
|
|
|
||||||
53
setup.py
53
setup.py
|
|
@ -7,6 +7,7 @@ https://github.com/pypa/sampleproject
|
||||||
|
|
||||||
# Always prefer setuptools over distutils
|
# Always prefer setuptools over distutils
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
# To use a consistent encoding
|
# To use a consistent encoding
|
||||||
from codecs import open
|
from codecs import open
|
||||||
from os import path
|
from os import path
|
||||||
|
|
@ -14,47 +15,41 @@ from os import path
|
||||||
here = path.abspath(path.dirname(__file__))
|
here = path.abspath(path.dirname(__file__))
|
||||||
|
|
||||||
# Get the long description from the README file
|
# Get the long description from the README file
|
||||||
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
|
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
|
||||||
long_description = f.read()
|
long_description = f.read()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='adafruit-circuitpython-ds3231',
|
name="adafruit-circuitpython-ds3231",
|
||||||
|
|
||||||
use_scm_version=True,
|
use_scm_version=True,
|
||||||
setup_requires=['setuptools_scm'],
|
setup_requires=["setuptools_scm"],
|
||||||
|
description="CircuitPython library for DS3231 precision real-time clock.",
|
||||||
description='CircuitPython library for DS3231 precision real-time clock.',
|
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type='text/x-rst',
|
long_description_content_type="text/x-rst",
|
||||||
|
|
||||||
# The project's main homepage.
|
# The project's main homepage.
|
||||||
url='https://github.com/adafruit/Adafruit_CircuitPython_DS3231',
|
url="https://github.com/adafruit/Adafruit_CircuitPython_DS3231",
|
||||||
|
|
||||||
# Author details
|
# Author details
|
||||||
author='Adafruit Industries',
|
author="Adafruit Industries",
|
||||||
author_email='circuitpython@adafruit.com',
|
author_email="circuitpython@adafruit.com",
|
||||||
|
install_requires=[
|
||||||
install_requires=['adafruit-circuitpython-register', 'adafruit-circuitpython-busdevice'],
|
"adafruit-circuitpython-register",
|
||||||
|
"adafruit-circuitpython-busdevice",
|
||||||
|
],
|
||||||
# Choose your license
|
# Choose your license
|
||||||
license='MIT',
|
license="MIT",
|
||||||
|
|
||||||
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 3 - Alpha',
|
"Development Status :: 3 - Alpha",
|
||||||
'Intended Audience :: Developers',
|
"Intended Audience :: Developers",
|
||||||
'Topic :: Software Development :: Libraries',
|
"Topic :: Software Development :: Libraries",
|
||||||
'Topic :: System :: Hardware',
|
"Topic :: System :: Hardware",
|
||||||
'License :: OSI Approved :: MIT License',
|
"License :: OSI Approved :: MIT License",
|
||||||
'Programming Language :: Python :: 3',
|
"Programming Language :: Python :: 3",
|
||||||
'Programming Language :: Python :: 3.4',
|
"Programming Language :: Python :: 3.4",
|
||||||
'Programming Language :: Python :: 3.5',
|
"Programming Language :: Python :: 3.5",
|
||||||
],
|
],
|
||||||
|
|
||||||
# What does your project relate to?
|
# What does your project relate to?
|
||||||
keywords='adafruit precision real-time real time clock breakout hardware micropython circuitpython',
|
keywords="adafruit precision real-time real time clock breakout hardware micropython circuitpython",
|
||||||
|
|
||||||
# You can just specify the packages manually here if your project is
|
# You can just specify the packages manually here if your project is
|
||||||
# simple. Or you can use find_packages().
|
# simple. Or you can use find_packages().
|
||||||
py_modules=['adafruit_ds3231'],
|
py_modules=["adafruit_ds3231"],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue