Compare commits
100 commits
print-cont
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c9f657bdc | |||
|
|
b73c3456d2 | ||
| 33ebbfac4f | |||
|
|
753837f65b | ||
| 86826f5bd4 | |||
|
|
80c8c8d65e | ||
| d554ce52e0 | |||
| 7e87ecccbd | |||
| aa7cdefe9a | |||
| db8b44f934 | |||
|
|
9327605e80 | ||
| 9cd33dda57 | |||
|
|
c81ed883c5 | ||
| d84a97b2e2 | |||
| b25a006a4b | |||
|
|
77b3687867 | ||
| 691b96d72d | |||
|
|
93fccb242d | ||
| 2656301150 | |||
|
|
7fa07ab555 | ||
| 475519c0e7 | |||
|
|
7a3ad56b0a | ||
| a106856fb6 | |||
|
|
c2dc55c758 | ||
| 75976b3f41 | |||
|
|
b67f5ce684 | ||
| 90e5cb95ac | |||
|
|
174acc986f | ||
| 98a343a738 | |||
|
|
e10d32198a | ||
| f3e0bc8266 | |||
|
|
f2a7ca44fa | ||
| 53c53a07b5 | |||
|
|
6589925608 | ||
| a8639df435 | |||
|
|
90fcda462f | ||
| e73e936673 | |||
|
|
4b81cde84d | ||
| 56bc42853d | |||
|
|
3b011fa041 | ||
| e689e52f08 | |||
|
|
c03f786252 | ||
| d0f8df59ad | |||
|
|
9de3ef9172 | ||
| e6dab099fb | |||
|
|
c7e572e464 | ||
| 0b005af416 | |||
|
|
68933efc83 | ||
| 3e885cb96c | |||
| 58389b892c | |||
| 85a0e594f6 | |||
| ad4b93e430 | |||
| 0457a674fb | |||
|
|
83930339ca | ||
| b9b484290f | |||
| 31d1a59850 | |||
| 39bdd7394d | |||
| 63f2c9861a | |||
| f5df740fb9 | |||
| e1fe886660 | |||
|
|
df98f477fa | ||
| 61ccd58bb0 | |||
|
|
41712b4d84 | ||
| ad4d1d6b90 | |||
|
|
b97ccb2192 | ||
| 23ea9472a4 | |||
| 181a581db1 | |||
| 273513a77f | |||
| 9c7e203e90 | |||
|
|
28a7edf0cc | ||
| 0bbd62bc69 | |||
|
|
45425f3e28 | ||
| 32bc4108ff | |||
|
|
0e2e15529b | ||
| 59c88b7ce5 | |||
|
|
efa6a36fd9 | ||
| be9017615f | |||
|
|
9af60d9411 | ||
| d46c6bc407 | |||
|
|
a6d4983318 | ||
| 294906d787 | |||
|
|
32856d6513 | ||
| 722b34fc89 | |||
|
|
97e49129e9 | ||
| 7b8f3a7991 | |||
| 48d050855b | |||
| b4430740a8 | |||
| 9d768243f5 | |||
|
|
04885e60ad | ||
| a703a6c702 | |||
|
|
4837d7d21b | ||
| 0accf285a7 | |||
|
|
b7d502e829 | ||
| 964c9201fd | |||
|
|
e2a5906d6d | ||
| 77948e62ac | |||
|
|
9264cb70a8 | ||
| d55a501da2 | |||
|
|
b17ae8cf2f | ||
| 13c998b645 |
17 changed files with 157 additions and 293 deletions
88
.github/workflows/build.yml
vendored
88
.github/workflows/build.yml
vendored
|
|
@ -8,89 +8,9 @@ on: [pull_request, push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: View context attributes
|
- name: Run Build CI workflow
|
||||||
uses: actions/github-script@v6
|
uses: adafruit/workflows-circuitpython-libs/build@main
|
||||||
with:
|
with:
|
||||||
script: console.log(JSON.stringify(context, null, 2))
|
package-prefix: jepler_udecimal
|
||||||
- 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.x
|
|
||||||
uses: actions/setup-python@v1
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
- 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 Sphinx, pre-commit
|
|
||||||
run: |
|
|
||||||
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit sphinx-autoapi
|
|
||||||
- name: Library version
|
|
||||||
run: git describe --dirty --always --tags
|
|
||||||
- name: Setup problem matchers
|
|
||||||
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
|
|
||||||
- name: Pre-commit hooks
|
|
||||||
run: |
|
|
||||||
pre-commit run --all-files
|
|
||||||
- name: Clone and build circuitpython unix port
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
[ -e circuitpython/py/py.mk ] || git clone --depth=1 https://github.com/adafruit/circuitpython
|
|
||||||
[ -e circuitpython/lib/libffi/autogen.sh ] || (cd circuitpython && git submodule update --init lib/libffi lib/axtls lib/berkeley-db-1.xx tools/huffman lib/uzlib extmod/ulab)
|
|
||||||
[ -x circuitpython/ports/unix/micropython ] || (
|
|
||||||
make -C circuitpython/mpy-cross -j$(nproc)
|
|
||||||
make -C circuitpython/ports/unix -j$(nproc) deplibs
|
|
||||||
make -C circuitpython/ports/unix -j$(nproc) DEBUG=1 STRIP=:
|
|
||||||
)
|
|
||||||
- name: Unit Test
|
|
||||||
run: |
|
|
||||||
python -m jepler_udecimal.test
|
|
||||||
if ! env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests.py -d examples; then
|
|
||||||
for exp in *.exp; do
|
|
||||||
testbase=$(basename $exp .exp);
|
|
||||||
echo -e "\nFAILURE $testbase";
|
|
||||||
diff -u $testbase.exp $testbase.out;
|
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- name: Build assets
|
|
||||||
run: circuitpython-build-bundles --package_folder_prefix jepler --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
|
|
||||||
- name: Archive bundles
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: bundles
|
|
||||||
path: ${{ github.workspace }}/bundles/
|
|
||||||
- name: Check For setup.py
|
|
||||||
id: need-pypi
|
|
||||||
run: |
|
|
||||||
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
|
||||||
- name: Build Python package
|
|
||||||
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
|
||||||
run: |
|
|
||||||
pip install --upgrade setuptools wheel twine readme_renderer testresources
|
|
||||||
python setup.py sdist
|
|
||||||
python setup.py bdist_wheel --universal
|
|
||||||
twine check dist/*
|
|
||||||
|
|
|
||||||
19
.github/workflows/failure-help-text.yml
vendored
Normal file
19
.github/workflows/failure-help-text.yml
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# SPDX-FileCopyrightText: 2021 Scott Shawcroft for Adafruit Industries
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
name: Failure help text
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Build CI"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post-help:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }}
|
||||||
|
steps:
|
||||||
|
- name: Post comment to help
|
||||||
|
uses: adafruit/circuitpython-action-library-ci-failed@v1
|
||||||
85
.github/workflows/release.yml
vendored
85
.github/workflows/release.yml
vendored
|
|
@ -1,85 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
name: Release Actions
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upload-release-assets:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
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.7
|
|
||||||
uses: actions/setup-python@v1
|
|
||||||
with:
|
|
||||||
python-version: 3.7
|
|
||||||
- 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 --package_folder_prefix jepler --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-20.04
|
|
||||||
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: __token__
|
|
||||||
TWINE_PASSWORD: ${{ secrets.pypi_token }}
|
|
||||||
run: |
|
|
||||||
python setup.py sdist
|
|
||||||
twine upload dist/*
|
|
||||||
20
.github/workflows/release_gh.yml
vendored
Normal file
20
.github/workflows/release_gh.yml
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
name: GitHub Release Actions
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
upload-release-assets:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Run GitHub Release CI workflow
|
||||||
|
uses: adafruit/workflows-circuitpython-libs/release-gh@main
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
upload-url: ${{ github.event.release.upload_url }}
|
||||||
|
package-prefix: jepler_udecimal
|
||||||
19
.github/workflows/release_pypi.yml
vendored
Normal file
19
.github/workflows/release_pypi.yml
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
name: PyPI Release Actions
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
upload-release-assets:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Run PyPI Release CI workflow
|
||||||
|
uses: adafruit/workflows-circuitpython-libs/release-pypi@main
|
||||||
|
with:
|
||||||
|
pypi-username: __token__
|
||||||
|
pypi-password: ${{ secrets.pypi_token }}
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -20,3 +20,4 @@ docs/api
|
||||||
circuitpython
|
circuitpython
|
||||||
/*.exp
|
/*.exp
|
||||||
/*.out
|
/*.out
|
||||||
|
*/__version__.py
|
||||||
|
|
|
||||||
|
|
@ -4,28 +4,28 @@
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 22.3.0
|
rev: 25.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
- repo: https://github.com/fsfe/reuse-tool
|
- repo: https://github.com/fsfe/reuse-tool
|
||||||
rev: v1.0.0
|
rev: v5.0.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: reuse
|
- id: reuse
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.2.0
|
rev: v5.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- repo: https://github.com/pycqa/pylint
|
- repo: https://github.com/pycqa/pylint
|
||||||
rev: v2.14.1
|
rev: v3.3.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: pylint
|
- id: pylint
|
||||||
name: lint (examples)
|
name: lint (examples)
|
||||||
types: [python]
|
types: [python]
|
||||||
files: ^examples/
|
files: ^examples/
|
||||||
args:
|
args:
|
||||||
- --disable=missing-docstring,invalid-name,bad-whitespace
|
- --disable=missing-docstring,invalid-name
|
||||||
- id: pylint
|
- id: pylint
|
||||||
name: lint (code)
|
name: lint (code)
|
||||||
types: [python]
|
types: [python]
|
||||||
|
|
|
||||||
|
|
@ -391,10 +391,3 @@ 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=1
|
min-public-methods=1
|
||||||
|
|
||||||
|
|
||||||
[EXCEPTIONS]
|
|
||||||
|
|
||||||
# Exceptions that will emit a warning when being caught. Defaults to
|
|
||||||
# "Exception"
|
|
||||||
overgeneral-exceptions=Exception
|
|
||||||
|
|
|
||||||
19
.readthedocs.yaml
Normal file
19
.readthedocs.yaml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
|
# Read the Docs configuration file
|
||||||
|
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||||
|
|
||||||
|
# Required
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
build:
|
||||||
|
os: ubuntu-20.04
|
||||||
|
tools:
|
||||||
|
python: "3"
|
||||||
|
|
||||||
|
python:
|
||||||
|
install:
|
||||||
|
- requirements: docs/requirements.txt
|
||||||
|
- requirements: requirements.txt
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Unlicense
|
|
||||||
|
|
||||||
python:
|
|
||||||
version: 3
|
|
||||||
requirements_file: docs/requirements.txt
|
|
||||||
23
build.sh
23
build.sh
|
|
@ -9,17 +9,12 @@ echo "=== Create and set up virtual environment"
|
||||||
. .env/bin/activate
|
. .env/bin/activate
|
||||||
echo "=== Install requirements"
|
echo "=== Install requirements"
|
||||||
pip3 install wheel
|
pip3 install wheel
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements_dev.txt
|
||||||
echo "=== Run pre-commit"
|
echo "=== Run pre-commit"
|
||||||
pre-commit run --all-files
|
pre-commit run --all-files
|
||||||
echo "=== Run pylint"
|
|
||||||
pylint jepler_udecimal
|
|
||||||
if [ -d examples ]; then
|
|
||||||
pylint --disable=missing-docstring,invalid-name,bad-whitespace examples
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Clone and build circuitpython unix port"
|
echo "=== Clone and build circuitpython unix port"
|
||||||
[ -e circuitpython/py/py.mk ] || git clone --depth=1 https://github.com/adafruit/circuitpython
|
[ -e circuitpython/py/py.mk ] || git clone --shallow-since=2021-07-01 https://github.com/adafruit/circuitpython
|
||||||
[ -e circuitpython/lib/libffi/autogen.sh ] || (cd circuitpython && git submodule update --init lib/libffi lib/axtls lib/berkeley-db-1.xx tools/huffman lib/uzlib extmod/ulab)
|
[ -e circuitpython/lib/libffi/autogen.sh ] || (cd circuitpython && git submodule update --init lib/libffi lib/axtls lib/berkeley-db-1.xx tools/huffman lib/uzlib extmod/ulab)
|
||||||
[ -x circuitpython/ports/unix/micropython ] || (
|
[ -x circuitpython/ports/unix/micropython ] || (
|
||||||
make -C circuitpython/mpy-cross -j$(nproc)
|
make -C circuitpython/mpy-cross -j$(nproc)
|
||||||
|
|
@ -30,12 +25,14 @@ make -C circuitpython/ports/unix -j$(nproc) DEBUG=1 STRIP=:
|
||||||
echo "=== Run tests"
|
echo "=== Run tests"
|
||||||
python -m jepler_udecimal.test
|
python -m jepler_udecimal.test
|
||||||
|
|
||||||
if ! env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests -d examples; then
|
run-tests () {
|
||||||
for exp in *.exp; do
|
env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests.py "$@"
|
||||||
testbase=$(basename $exp .exp);
|
}
|
||||||
echo -e "\nFAILURE $testbase";
|
|
||||||
diff -u $testbase.exp $testbase.out;
|
run-tests --clean-failures
|
||||||
done
|
if ! run-tests -d examples; then
|
||||||
|
run-tests --print-failures
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PYTHONPATH=. python examples/test_udecimal.py > test_udecimal.exp
|
PYTHONPATH=. python examples/test_udecimal.py > test_udecimal.exp
|
||||||
|
|
|
||||||
12
docs/conf.py
12
docs/conf.py
|
|
@ -109,18 +109,6 @@ napoleon_numpy_docstring = False
|
||||||
#
|
#
|
||||||
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
|
|
||||||
try:
|
|
||||||
import sphinx_rtd_theme
|
|
||||||
|
|
||||||
html_theme = "sphinx_rtd_theme"
|
|
||||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
|
|
||||||
except:
|
|
||||||
html_theme = "default"
|
|
||||||
html_theme_path = ["."]
|
|
||||||
else:
|
|
||||||
html_theme_path = ["."]
|
|
||||||
|
|
||||||
# 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".
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,9 @@
|
||||||
from jepler_udecimal import Decimal
|
from jepler_udecimal import Decimal
|
||||||
|
|
||||||
|
|
||||||
def moneyfmt(value, places=2, curr="", sep=",", dp=".", pos="", neg="-", trailneg=""):
|
def moneyfmt(
|
||||||
|
value, *, places=2, curr="", sep=",", dp=".", pos="", neg="-", trailneg=""
|
||||||
|
):
|
||||||
"""Convert Decimal to a money formatted string.
|
"""Convert Decimal to a money formatted string.
|
||||||
|
|
||||||
places: required number of places after the decimal point
|
places: required number of places after the decimal point
|
||||||
|
|
|
||||||
|
|
@ -1798,16 +1798,16 @@ class Decimal(object):
|
||||||
else:
|
else:
|
||||||
return -self._round_down(prec)
|
return -self._round_down(prec)
|
||||||
|
|
||||||
_pick_rounding_function = dict(
|
_pick_rounding_function = {
|
||||||
ROUND_DOWN=_round_down,
|
ROUND_DOWN: _round_down,
|
||||||
ROUND_UP=_round_up,
|
ROUND_UP: _round_up,
|
||||||
ROUND_HALF_UP=_round_half_up,
|
ROUND_HALF_UP: _round_half_up,
|
||||||
ROUND_HALF_DOWN=_round_half_down,
|
ROUND_HALF_DOWN: _round_half_down,
|
||||||
ROUND_HALF_EVEN=_round_half_even,
|
ROUND_HALF_EVEN: _round_half_even,
|
||||||
ROUND_CEILING=_round_ceiling,
|
ROUND_CEILING: _round_ceiling,
|
||||||
ROUND_FLOOR=_round_floor,
|
ROUND_FLOOR: _round_floor,
|
||||||
ROUND_05UP=_round_05up,
|
ROUND_05UP: _round_05up,
|
||||||
)
|
}
|
||||||
|
|
||||||
def __round__(self, n=None):
|
def __round__(self, n=None):
|
||||||
"""Round self to the nearest integer, or to a given precision.
|
"""Round self to the nearest integer, or to a given precision.
|
||||||
|
|
@ -3357,7 +3357,7 @@ class Context(object):
|
||||||
:param bool clamp: If true, change exponents if too high
|
:param bool clamp: If true, change exponents if too high
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__( # pylint: disable=too-many-positional-arguments
|
||||||
self,
|
self,
|
||||||
prec=None,
|
prec=None,
|
||||||
rounding=None,
|
rounding=None,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
pre-commit
|
pre-commit
|
||||||
recommonmark==0.6.0
|
recommonmark==0.6.0
|
||||||
sphinx<4
|
sphinx
|
||||||
sphinx-autoapi
|
sphinx-autoapi
|
||||||
sphinxcontrib-svg2pdfconverter==0.1.0
|
sphinxcontrib-svg2pdfconverter==0.1.0
|
||||||
sphinx-rtd-theme
|
sphinx-rtd-theme
|
||||||
|
|
@ -2,5 +2,48 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Unlicense
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
[tool.black]
|
[build-system]
|
||||||
target-version = ['py35']
|
requires = [
|
||||||
|
"setuptools",
|
||||||
|
"wheel",
|
||||||
|
"setuptools-scm",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "circuitpython-jepler-udecimal"
|
||||||
|
description = "Reduced version of the decimal library for CircuitPython"
|
||||||
|
version = "0.0.0+auto.0"
|
||||||
|
readme = "README.rst"
|
||||||
|
authors = [
|
||||||
|
{name = "Jeff Epler", email = "jepler@gmail.com"}
|
||||||
|
]
|
||||||
|
urls = { Source = "https://github.com/jepler/Jepler_CircuitPython_udecimal", Documentation = "https://jepler-udecimal.readthedocs.io/en/latest/api/jepler_udecimal/index.html", Tracker = "https://github.com/jepler/Jepler_CircuitPython_udecimal/issues" }
|
||||||
|
# "Pull Requests" = "https://github.com/jepler/Jepler_CircuitPython_udecimal/pulls",
|
||||||
|
keywords = [
|
||||||
|
"adafruit",
|
||||||
|
"blinka",
|
||||||
|
"circuitpython",
|
||||||
|
"micropython",
|
||||||
|
"udecimal",
|
||||||
|
"numeric",
|
||||||
|
"helper",
|
||||||
|
"arbitraryprecision",
|
||||||
|
"math",
|
||||||
|
]
|
||||||
|
license = {text = "MIT"}
|
||||||
|
classifiers = [
|
||||||
|
"Intended Audience :: Developers",
|
||||||
|
"Topic :: Software Development :: Libraries",
|
||||||
|
"Topic :: Software Development :: Embedded Systems",
|
||||||
|
"Topic :: System :: Hardware",
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"License :: OSI Approved :: Python Software Foundation License",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
]
|
||||||
|
dynamic = ["dependencies", "optional-dependencies"]
|
||||||
|
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
packages=['jepler_udecimal']
|
||||||
|
[tool.setuptools_scm]
|
||||||
|
write_to = "jepler_udecimal/__version__.py"
|
||||||
|
|
|
||||||
65
setup.py
65
setup.py
|
|
@ -1,65 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
|
||||||
# SPDX-FileCopyrightText: Copyright (c) 2020 jepler for Unpythonic Networks
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
"""A setuptools based setup module.
|
|
||||||
|
|
||||||
See:
|
|
||||||
https://packaging.python.org/en/latest/distributing.html
|
|
||||||
https://github.com/pypa/sampleproject
|
|
||||||
"""
|
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
|
||||||
|
|
||||||
# To use a consistent encoding
|
|
||||||
from codecs import open
|
|
||||||
from os import path
|
|
||||||
|
|
||||||
here = path.abspath(path.dirname(__file__))
|
|
||||||
|
|
||||||
# Get the long description from the README file
|
|
||||||
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
|
|
||||||
long_description = f.read()
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name="jepler-circuitpython-udecimal",
|
|
||||||
use_scm_version=True,
|
|
||||||
setup_requires=["setuptools_scm"],
|
|
||||||
description="Reduced version of the decimal library for CircuitPython",
|
|
||||||
long_description=long_description,
|
|
||||||
long_description_content_type="text/x-rst",
|
|
||||||
# The project's main homepage.
|
|
||||||
url="https://github.com/jepler/Jepler_CircuitPython_udecimal",
|
|
||||||
project_urls={
|
|
||||||
"Source": "https://github.com/jepler/Jepler_CircuitPython_udecimal",
|
|
||||||
"Documentation": "https://jepler-udecimal.readthedocs.io/en/latest/api/jepler_udecimal/index.html",
|
|
||||||
"Tracker": "https://github.com/jepler/Jepler_CircuitPython_udecimal/issues",
|
|
||||||
"Pull Requests": "https://github.com/jepler/Jepler_CircuitPython_udecimal/pulls",
|
|
||||||
},
|
|
||||||
# Author details
|
|
||||||
author="Jeff Epler",
|
|
||||||
author_email="jepler@gmail.com",
|
|
||||||
install_requires=[],
|
|
||||||
# Choose your license
|
|
||||||
license="MIT",
|
|
||||||
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
|
||||||
classifiers=[
|
|
||||||
"Development Status :: 3 - Alpha",
|
|
||||||
"Intended Audience :: Developers",
|
|
||||||
"Topic :: Software Development :: Libraries",
|
|
||||||
"License :: OSI Approved :: MIT License",
|
|
||||||
"License :: OSI Approved :: Python Software Foundation License ",
|
|
||||||
"Programming Language :: Python :: 3",
|
|
||||||
"Programming Language :: Python :: 3.4",
|
|
||||||
"Programming Language :: Python :: 3.5",
|
|
||||||
"Programming Language :: Python :: 3.6",
|
|
||||||
"Programming Language :: Python :: 3.7",
|
|
||||||
],
|
|
||||||
# What does your project relate to?
|
|
||||||
keywords="adafruit blinka circuitpython micropython udecimal numeric helper "
|
|
||||||
"arbitraryprecision math",
|
|
||||||
# You can just specify the packages manually here if your project is
|
|
||||||
# simple. Or you can use find_packages().
|
|
||||||
packages=["jepler_udecimal"],
|
|
||||||
)
|
|
||||||
Loading…
Reference in a new issue