GithubHelp home page GithubHelp logo

codal-bootstrap's Introduction

CODAL-Bootstrap

Bootstrap a new project from scratch

Bootstrap a CODAL-based project from a single Python script.

An example of creating a microbit-v2 project from just one initial build file: asciicast

Usage

  1. Download a copy of ./build.py ( curl/wget/download link ) from this repository and put in a new folder for your project
  2. In the terminal/console run ./build.py to retrieve a list of valid targets
  3. Run ./build.py codal-microbit-v2 (replace codal-microbit-v2 with your selected target)
  4. Write your code in the newly created source/ directory

Any further runs of ./build.py will now use the latest downloaded version of the build tools, and will take the same arguments as traditional builds (see ./build.py --help for deatils).

Alternative Targets

Some additional targets can be included by including new URLs to build.py's TARGET_LIST variable, by default this is as follows:

TARGET_LIST = [
    "https://raw.githubusercontent.com/lancaster-university/codal/master/utils/targets.json"
]

To add the beta-targets list, include the URL: https://raw.githubusercontent.com/lancaster-university/codal-bootstrap/main/beta-targets.json like so:

TARGET_LIST = [
    "https://raw.githubusercontent.com/lancaster-university/codal/master/utils/targets.json",
    "https://raw.githubusercontent.com/lancaster-university/codal-bootstrap/main/beta-targets.json"
]

How do I reset bootstrap to run it again?

To force bootstrap mode to run again, simply remove the codal.json file in your project directory, and follow the installation steps above. You may also want to remove your libraries folder entirely to force all libraries to be re-downloaded.

codal-bootstrap's People

Contributors

johnvidler avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codal-bootstrap's Issues

Build tool support to aid issue reporting

It would be useful for build.py to report the status of all loaded libraries in a succinct way, such that it can be copy/pasted into github issues.

We already have --status but this needs to be revisited to ensure it meets all the requirements for reporting issues... perhaps an enhanced github-centric --info call which would include all current changesets, all current version hashes (inc tags, if on a tagged branch) the current build target and so forth.

Needs discussion as to what would be included here; here is a non-exhaustive list of what I think would be useful right now, but if anyone has any ideas for further inclusion... @microbit-carlos or @finneyj perhaps?

  • Current target platform
  • Current git tag or hash for each library
  • Current git tag or hash for the root project
  • The contents of codal.json, for the flags being used

colorama module not found on macOS 12 when using build.py

using d5cd62c

jonny@machine codalproject % ./build.py 
Traceback (most recent call last):
  File "./build.py", line 33, in <module>
    from colorama import Fore, Back, Style
ModuleNotFoundError: No module named 'colorama'
jonny@machine codalproject % 

on my machine, I could resolve this with
python3 -m pip install colorama

Documentation generation fails due to python include path errors

The documentation generation function of build.py includes a bunch of utility libraries on the utils/python subpath, but as these are outside the python include path, they fail to resolve and halt the script.

These all need to be moved to either:

  • Dynamic includes via importlib with the paths corrected
  • An updated system path at runtime to match the inner script root

[SSL: CERTIFICATE_VERIFY_FAILED] unable to get local issuer certificate running build.py

I'm getting an error stating that an SSL certificate cannot be validated upon running .\build.py:

I'm running this on macOS V13.2, with python V3.10.9

Am I missing a python package? Something else? (pip3 list lists only pip itself, V23.0).

Downloading codal-bootstrap...
Cloning into '/Users/me/src/MyProject/libraries/codal-bootstrap'...
remote: Enumerating objects: 280, done.
remote: Counting objects: 100% (280/280), done.
remote: Compressing objects: 100% (151/151), done.
remote: Total 280 (delta 151), reused 218 (delta 93), pack-reused 0
Receiving objects: 100% (280/280), 71.75 KiB | 536.00 KiB/s, done.
Resolving deltas: 100% (151/151), done.
Please supply an initial target to build against:
Downloading valid targets...
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/me/src/MyProject/./build.py", line 51, in <module>
    bootstrap.go_bootstrap( TARGET_LIST )
  File "/Users/me/src/MyProject/libraries/codal-bootstrap/bootstrap.py", line 285, in go_bootstrap
    list_valid_targets( target_list )
  File "/Users/me/src/MyProject/libraries/codal-bootstrap/bootstrap.py", line 155, in list_valid_targets
    targets = download_targets( target_list )
  File "/Users/me/src/MyProject/libraries/codal-bootstrap/bootstrap.py", line 78, in download_targets
    r = urllib.request.urlopen( url )
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>

Automation test issue

Not a real issue, just testing the github action to ensure it works on something that won't matter :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.