Commit Graph

58 Commits

Author SHA1 Message Date
Jeff Epler 770d1b269f
The very name "synthetic.po" caused problems with weblate
.. because it would add every term from circuitpython.pot to it;
then in turn, "make translate" would remove almost every message
from circuitpython.pot, and then give a pre-commit error.

Hopefully "synthetic.pot" won't get the same treatment.

This may require manual intervention on weblate to resolve a merge
conflict and undo weblate's chyange to synthetic.po/.pot.
2023-11-15 12:02:19 -06:00
Jeff Epler f2bd258131
Ensure translate and check-translate use the same command
They had diverged. This doesn't appear to be the cause of the build failure
on #8614, but it doesn't hurt to make sure they always match.
2023-11-15 11:57:52 -06:00
Dan Halbert 58b111d428
Merge pull request #8608 from jepler/add-locale-module
Add `locale.getlocale()`
2023-11-15 09:24:04 -05:00
Jeff Epler 46bfbad1bb
Add `locale.getlocale()`
This returns the localization of the running CircuitPython, such as
en_US, fr, etc.

Additional changes are needed in build infrastructure since the
string "en_US" should not appear to be translated in weblate, ever;
instead the value comes from the translation metadata.

Closes: #8602
2023-11-14 21:20:03 -06:00
Jeff Epler 6db9f2e73f
Rework ci_fetch_deps and use it from makefiles too
* teach ci_fetch_deps about --filter=blob:none
 * change logic ensuring tags in frozen/ are fetched
 * since check=True was all the time, remove unused kwarg
 * add fetch-board-submodules

Closes: #8588
2023-11-12 12:32:34 -06:00
Jeff Epler 774f6ac6ab
Switch to using MP_ERROR_TEXT instead of translate, globally 2023-10-30 09:49:06 +01:00
Dan Halbert 38f6fa27e3 fetch-port-submodules; fetch-all-submodules 2023-06-05 17:23:34 -04:00
Tekktrik 6f8670a284 Updated how stubs are built 2023-05-09 22:01:24 -04:00
Marco Sirabella 863042dfd0 Move git command to update necessary tags to submodule
I ran into this one since I did an initial shallow clone due to slow
pycon 2023 wifi.
2023-04-25 16:05:20 -06:00
Dan Halbert 94f487c08d handle older versions of git for make fetch-submodules; add remove-submodules 2023-03-24 22:45:12 -04:00
Dan Halbert ae95274b66 use blobless partial clone for make fetch-submodules 2023-03-21 11:43:33 -04:00
Bill Sideris 309a5e600d
Hide it. 2023-02-17 20:46:30 +02:00
Jeff Epler 2901399cc6
No need to depend it here, conf.py runs `make stubs` 2022-12-26 10:53:57 -06:00
Jonah cb2bf41be6 Add fetch-modules to `make help` for main makefile 2022-05-11 23:45:37 -04:00
Scott Shawcroft 2592fcbab2
Ignore failure of first command. It's deliberate 2021-11-29 16:25:15 -08:00
Scott Shawcroft 0a27f7c3ab
Add `make fetch-submodules` to update submodules
This also sets rpi-firmware as shallow in case submodules are
updated manually.

Fixes #5619
2021-11-29 16:19:22 -08:00
microDev be3fca81e7
fix espidf docs 2021-09-17 21:27:18 +05:30
microDev e91fb247a3
build docs dynamically 2021-09-16 00:05:42 +05:30
Scott Shawcroft 973a90f2aa
Rename esp32s2 port to espressif
This is in preparation for ESP32-S3 support and potentially others.

Related to #4363
2021-09-13 16:44:55 -07:00
Scott Shawcroft c16f559574
Merge pull request #4907 from jepler/refine-stubs
refine stubs-building procedure
2021-07-15 12:11:58 -07:00
Jeff Epler 66155ff539 Exclude files inside ulab from translation
.. These files can be created if the developer runs
"./build.sh" or "./build-cp.sh" inside extmod/ulab.
2021-07-07 09:07:21 -05:00
Jeff Epler f51ca53553 refine stubs-building procedure
* so that excess files are not included in sdist, perform build down
   in circuitpython-stubs
 * This means we need to
   * Remove the need-pypi check
   * Copy a setup.py, README, and MANIFEST.in into the stubs build location
   * Revamp how the overall `mypy --strict` check lists its inputs
 * Add a new test that actually installing the stubs lets us do type
   checking (tools/test-stubs.sh)
 * Add a missing return type to a __init__ function (why was this not
   an error under `mypy --strict`, I wonder)
2021-06-22 08:59:05 -05:00
Scott Shawcroft f0bb26d70f
Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
microDev 76256821ec
add translations for raspberrypi port 2021-01-28 20:02:00 +05:30
Scott Shawcroft 733094aead
Add initial RP2040 support
The RP2040 is new microcontroller from Raspberry Pi that features
two Cortex M0s and eight PIO state machines that are good for
crunching lots of data. It has 264k RAM and a built in UF2
bootloader too.

Datasheet: https://pico.raspberrypi.org/files/rp2040_datasheet.pdf
2021-01-20 19:16:56 -08:00
Jeff Epler e4129ecf00 Makefile: Remove POT-Creation-Date from circuitpython.pot
This line is only a magnet for conflicts; the date that circuitpython.pot
was modified can be extracted from git metadata.  Additionally, when
we add "make translate" checking to pre-commit, this will avoid spurious
changes since the most straightforward implementation would otherwise
update this line every time pre-commit executed.
2021-01-07 14:41:29 -06:00
Scott Shawcroft 40118bcf57
Add `board_deinit` for use with sleep
This changes lots of files to unify `board.h` across ports. It adds
`board_deinit` when CIRCUITPY_ALARM is set. `main.c` uses it to
deinit the board before deep sleeping (even when pretending.)

Deep sleep is now a two step process for the port. First, the
port should prepare to deep sleep based on the given alarms. It
should set alarms for both deep and pretend sleep. In particular,
the pretend versions should be set immediately so that we don't
miss an alarm as we shutdown. These alarms should also wake from
`port_idle_until_interrupt` which is used when pretending to deep
sleep.

Second, when real deep sleeping, `alarm_enter_deep_sleep` is called.
The port should set any alarms it didn't during prepare based on
data it saved internally during prepare.

ESP32-S2 sleep is a bit reorganized to locate more logic with
TimeAlarm. This will help it scale to more alarm types.

Fixes #3786
2020-12-08 10:52:25 -08:00
Jeff Epler 618d22cd69 Makefile: translate: exclude e.g., ports/unix/build as well 2020-10-01 11:00:33 -05:00
Jeff Epler 8f8326fe57 Makefile: Correct and expand translation excluded directories
As originally written, the TRANSLATE_SOURCES_EXC was incorrect.  If
more than one build directory existed, "make translate"
(and make check-translate) would error.

I corrected the problem, commented it, and added a number of additional
exclude directives.

I reviewed the PR and should have caught this, but did not.
2020-09-29 19:57:53 -05:00
microDev 4c7d9e3aaf
Update make translate script 2020-09-29 11:14:30 +05:30
Taku Fukada 9582cc5bd5 Add `make check-stubs` for validating Python stubs 2020-08-04 20:41:34 +09:00
Jeff Epler 9b8df7f635 Upgrade ulab
This version
 * moves source files to reflect module structure
 * adds inline documentation suitable for extract_pyi
 * incompatibly moves spectrogram to fft
 * incompatibly removes "extras"

There are some remaining markup errors in the specific revision of
extmod/ulab but they do not prevent the doc building process from
completing.
2020-07-28 16:57:48 -05:00
Diego Elio Pettenò 34b4993d63 Add license to some obvious files. 2020-07-06 19:16:25 +01:00
Scott Shawcroft c3d1256d76
Add one-of-each build target at the top level. 2020-06-30 15:30:07 -07:00
Scott Shawcroft a26102607e
Add UART support 2020-06-24 12:47:58 -07:00
Jeff Epler 79e2ede7c1 Makefile: "make translate" will only update circuitpython.pot
We can now rely on weblate to regularly update the individual language
files from the template, so "make translate" only needs to update the
template file circuitpython.pot.

This is advantageous because updating the other files in locale/ was
a frequent source of merge conflicts; resolving the conflict incorrectly
was something that could easily occur (and did).
2020-06-01 07:51:57 -05:00
Scott Shawcroft 0e6813d084
Fix merge-translate by starting with 'theirs' 2020-05-29 10:17:42 -07:00
Scott Shawcroft 8a42c33dca
Add top level merge-translate target 2020-05-20 10:49:01 -07:00
Scott Shawcroft afc84c2fd1
Fix ulab, math and template. 2020-05-14 15:58:36 -07:00
Scott Shawcroft 4e8de3c554
Swap sphinx to autoapi and the inline stubs 2020-05-12 17:28:24 -07:00
Scott Shawcroft 46713482f4
Add verification script 2020-04-27 14:36:14 -07:00
Jeff Epler 38a718ff55 Translations: follow stm port rename, run 'make translate' 2020-03-17 16:42:13 -05:00
Scott Shawcroft 834259a2cf
Update translations and translation sources 2020-01-18 11:57:57 -08:00
Jeff Epler 8e9ac59396 Makefile: Fix a problem where `xargs` invoked `xgettext` 2x
On a Debian 10 system, the number of arguments to xargs was such that
it would not fit in a single invocation (xargs --show-limits prints
"bytes: Size of command buffer we are actually using: 131072").

In this situation, the output from the second invocation of xgettext
would replace the output of the first one, so messages that appeared only
in files early in the list would be lost.  Strings in "extmod" were most
frequently the victim, including "incorrect padding" from modubinascii.c.

Unfortunately, when the github environment was similar enough to the
environment where "make translate" was invoked, the problem was not
found by "check-translate", because the same (incorrect, truncated)
potfile would be generated on both systems.  Apparently Ubuntu and Debian
were different enough that the problem could become visible.

xgettext has a mode where it reads files from stdin ('-f-'), but this does
not have a zero-delimited variant documented.  Still, we will assume
that files with adversarial names are not committed to circuitpython
or created by the build process, and print newline-delimited filenames
from `find` to be processed by `xgettext -f-`.
2019-11-17 21:00:07 -06:00
Craig Forbes d852d0f043 Explicitly set the locale when sorting translation files. 2019-06-18 16:59:05 -05:00
Dan Halbert 4fc189b60c Merge latest 4.0.x fixes into master 2019-06-11 16:16:29 -04:00
John Reese e8521c8379 Clean up egg-info directory as well 2019-06-02 15:12:29 -07:00
Dan Halbert 71c7aca29c Add top-level Makefile target to update frozen libs easily; Update CPX lib 2019-05-28 09:09:00 -04:00
John Reese 7f7665c1c0 Use rst2pyi to generate type stubs and package 2019-05-25 21:32:06 -07:00
Scott Shawcroft e74f5d5d76
Have xargs expect null termination 2019-05-14 10:42:52 -07:00