Skip to main content

Synthesized SDK

Project description

Synthesized

lint-test Quality Gate Status Coverage Technical Debt Supported OS Supported OS Documentation


synthesize

Downloading (for customers without access to this repo)

The SDK wheels can be downloaded from the publically available google cloud storage link: https://storage.googleapis.com/synthesized_sdk_builds/latest/synthesized-wheels.7z.

Using the provided password, the 7-Zip archive can be decrypted using p7zip.

$ 7z x synthesized-wheels.7z -p'<ZIP_PASSWORD>'

Installation / Usage

macOS

0. Make sure you have brew installed.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

1. Download external python requirements.

Make sure latest command line tools are installed: 'xcode-select --install'/Software Update. openssl sqlite3 zlib are required but already supplied by mac os. You can also install them if you are unsure.

brew update
brew install openssl readline sqlite3 xz bzip2

The following needs to be added into your shell profile:

# ~/.zprofile
export PATH="/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include"
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig"

Restart your terminal at this stage.

2. Install pyenv.

You may need to replace .zprofile/.zshrc with .profile/.bashrc if you don't use zshell.

brew install pyenv
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
echo 'eval "$(pyenv init -)"' >> ~/.zshrc

Restart your terminal again.

3. Install Python

Use the latest python 3.7, 3.8 or 3.9 if possible.

pyenv install 3.9.12
pyenv global 3.9.12

4. Clone the repo:

It's convienient to clone the repo to your home directory as done below.

cd ~
git clone git@github.com:synthesized-io/synthesized-sdk
cd synthesized-sdk

5. Create a virtual environment

Check your architecture! If your laptop has an intel CPU you will likely be using x86_64 architecture. If your laptop has a Mac M1 chip you will likely be on arm64 architecture.

For x86_64 architecture ONLY

python -m venv py39
source py39/bin/activate

For macOS arm64 architecture ONLY

Download and install openblas and hdf5 using brew.

brew install openblas hdf5

Update the following environment variables.

# ~/.zshrc
export HDF5_DIR="$(brew --prefix hdf5)"
export OPENBLAS="$(brew --prefix openblas)"

Create a virtual environment.

python -m venv py39
source py39/bin/activate

6. Install requirements

Dont forget to update pip!

pip install -U pip setuptools wheel
pip install -e ".[dev,test]"

7. Final bits!

Ask a team member how to get a synthesized key.

Set your SYNTHESIZED_KEY.

mkdir -p ~/.synthesized
echo "ABC********" > ~/.synthesized/key

Configure git hooks:

pre-commit install

If you want to use jupyter this will create the correct "kernel" in the notebook:

pip install jupyter
ipython kernel install --name "synth" --user

8. Run tests.

Just to make sure everything is working you can run:

synth-validate

Building Synthesized

Synthesized can be built by tagging a commit or running the GH action build-wheels locally with act. When locally run, the wheels are saved to the path: {synthesized_repo_path}/wheelhouse/synthesized-*.whl.

Installing act

You must install Docker Desktop and nektos/act

$ brew install docker --cask
$ brew install act

Before running them, you will need to add any missing secrets to a file called .secrets in your local repo. eg.

$ echo SYNTHESIZED_KEY=$(cat ~/.synthesized/key) >> .secrets

act also has a root config file which should be configured to use the docker image that closely resembles github's default containers.

$ echo '-P ubuntu-latest=nektos/act-environments-ubuntu:18.04' >> ~/.actrc

The synthesized wheels can then be built with the command below.

$ act -bj build-wheels

Building Docs

To build the docs you need to install the docs dependencies - note these only work for Python 3.8+:

$ pip install ".[docs]"

Then cd into the docs directory, set the DOCS_VERSION and DOCS_ROOT environment variables, and run the make html command:

$ cd docs
$ export 'DOCS_VERSION='$(echo $(git rev-parse HEAD | cut -c 1-8))
$ export 'DOCS_ROOT='$(pwd)'/_build' 
$ make html

The docs should be placed in synthesized-sdk/docs/_build/html.

Contributing

Please follow the link to read about contributing guidlines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

synthesized-2.1rc0-cp39-cp39-win_amd64.whl (5.3 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

synthesized-2.1rc0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

synthesized-2.1rc0-cp39-cp39-macosx_11_0_arm64.whl (5.9 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

synthesized-2.1rc0-cp39-cp39-macosx_10_9_x86_64.whl (6.6 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

synthesized-2.1rc0-cp38-cp38-win_amd64.whl (5.3 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

synthesized-2.1rc0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

synthesized-2.1rc0-cp38-cp38-macosx_11_0_arm64.whl (5.9 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

synthesized-2.1rc0-cp38-cp38-macosx_10_9_x86_64.whl (6.6 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

synthesized-2.1rc0-cp37-cp37m-win_amd64.whl (5.2 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

synthesized-2.1rc0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (31.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

synthesized-2.1rc0-cp37-cp37m-macosx_10_9_x86_64.whl (6.5 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page