Skip to content

Commit 0f89e52

Browse files
authored
Merge pull request #63 from jepler/incorrect-url
2 parents 266fab8 + e5a3a6e commit 0f89e52

File tree

6 files changed

+59
-21
lines changed

6 files changed

+59
-21
lines changed

.readthedocs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ build:
1313
tools:
1414
python: "3"
1515

16+
sphinx:
17+
configuration: docs/conf.py
18+
1619
python:
1720
install:
1821
- requirements: docs/requirements.txt

README.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,15 @@ Introduction
2323

2424
Reduced version of the decimal library for CircuitPython
2525

26+
Important Note
27+
==============
28+
From version 1.0.9 through 1.0.12, this package was incorrectly published on pypi under the name
29+
`circuitpython-jepler-udecimal <https://pypi.org/project/circuitpython-jepler-udecimal/>`_.
30+
The correct package name is
31+
`jepler-circuitpython-udecimal <https://pypi.org/project/jepler-circuitpython-udecimal/>`_.
2632

2733
Dependencies
28-
=============
34+
============
2935
This library depends on:
3036

3137
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_

build.sh

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,80 @@
11
#!/bin/bash
22
set -eo pipefail
33

4+
in_section=false
5+
if [ "${CI}" -eq "true" ]; then
6+
start_section () {
7+
if $in_section; then end_section; fi
8+
echo "::group::$*"
9+
export in_section=true
10+
}
11+
end_section () {
12+
echo "::endgroup::$*"
13+
in_section=false
14+
}
15+
else
16+
start_section () {
17+
if $in_section; then end_section; fi
18+
echo "=== $*"
19+
export in_section=true
20+
}
21+
end_section () {
22+
echo
23+
in_section=false
24+
}
25+
fi
26+
427
repo_name=`git config remote.origin.url | sed -e 's,^.*/,,;s/\.git$//' | tr A-Z_ a-z-`
5-
echo "=== Building package: $repo_name"
28+
echo "*** Building package: $repo_name"
629

7-
echo "=== Create and set up virtual environment"
30+
start_section "Create and set up virtual environment"
831
[ -d .venv ] || python3 -m venv .env
932
. .env/bin/activate
10-
echo "=== Install requirements"
33+
start_section "Install requirements"
1134
pip3 install wheel
12-
pip3 install -r requirements_dev.txt
13-
echo "=== Run pre-commit"
35+
pip3 install -r optional_requirements.txt
36+
start_section "Run pre-commit"
1437
pre-commit run --all-files
1538

16-
echo "=== Clone and build circuitpython unix port"
39+
start_section "Clone and build circuitpython unix port"
1740
[ -e circuitpython/py/py.mk ] || git clone --shallow-since=2021-07-01 https://github.com/adafruit/circuitpython
1841
[ -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)
1942
[ -x circuitpython/ports/unix/micropython ] || (
2043
make -C circuitpython/mpy-cross -j$(nproc)
21-
make -C circuitpython/ports/unix -j$(nproc) deplibs
44+
make -C circuitpython/ports/unix -j$(nproc) deplibs submodules
2245
make -C circuitpython/ports/unix -j$(nproc) DEBUG=1 STRIP=:
2346
)
2447

25-
echo "=== Run tests"
48+
start_section "Run tests"
2649
python -m jepler_udecimal.test
2750

28-
run-tests () {
29-
env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests.py "$@"
51+
run_tests () {
52+
env MICROPYPATH="`readlink -f .`" PYTHONPATH="`readlink -f .`" MICROPY_MICROPYTHON=circuitpython/ports/unix/build-standard/micropython circuitpython/tests/run-tests.py --keep-path "$@"
3053
}
3154

32-
run-tests --clean-failures
33-
if ! run-tests -d examples; then
34-
run-tests --print-failures
55+
run_tests --clean-failures
56+
if ! run_tests -d examples; then
57+
run_tests --print-failures
3558
exit 1
3659
fi
3760

3861
PYTHONPATH=. python examples/test_udecimal.py > test_udecimal.exp
39-
echo "=== Build CircuitPython bundle"
62+
start_section "Build CircuitPython bundle"
4063
circuitpython-build-bundles --package_folder_prefix jepler --filename_prefix $repo_name --library_location .
4164

42-
echo "=== Build docs"
65+
start_section "Build docs"
4366
rm -rf docs/_build
4467
(cd docs && sphinx-build -E -W -b html . _build/html)
4568

46-
echo "=== Build pypi files"
47-
python setup.py sdist
48-
python setup.py bdist_wheel --universal
69+
start_section "Build pypi files"
70+
python -m build
4971

50-
echo "=== Check pypi files"
72+
start_section "Check pypi files"
5173
twine check dist/*
74+
end_section
75+
76+
echo "=== Success"
77+
5278
# SPDX-FileCopyrightText: Copyright (c) 2020 jepler for Unpythonic Networks
5379
#
5480
# SPDX-License-Identifier: MIT

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"sphinx.ext.intersphinx",
2020
"sphinx.ext.napoleon",
2121
"sphinx.ext.todo",
22+
"sphinx_rtd_theme",
2223
]
2324

2425
autoapi_keep_files = True
@@ -107,7 +108,7 @@
107108
# The theme to use for HTML and HTML Help pages. See the documentation for
108109
# a list of builtin themes.
109110
#
110-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
111+
html_theme = "sphinx_rtd_theme"
111112

112113
# Add any paths that contain custom static files (such as style sheets) here,
113114
# relative to this directory. They are copied after the builtin static files,

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44

55
sphinx>=4.0.0
66
sphinx-autoapi
7+
sphinx-rtd-theme

optional_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-FileCopyrightText: Copyright (c) 2020 jepler for Unpythonic Networks
33
#
44
# SPDX-License-Identifier: MIT
5+
build
56
pre-commit
67
recommonmark==0.6.0
78
sphinx

0 commit comments

Comments
 (0)