-
Notifications
You must be signed in to change notification settings - Fork 5
docs: document how to install the alpha packages #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
neilcampbell
wants to merge
1
commit into
main
Choose a base branch
from
docs/use-package
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Language Specific Packages | ||
|
||
This section of the monorepo contains the language specific published packages which may or may not be built from shared rust code. | ||
|
||
## Installation | ||
|
||
Whilst we are building out the capabilities, we will likely be making a lot of breaking changes. | ||
As such we will only be releasing alpha versions of the packages for integration with internal tooling. | ||
At this point anything is open to change, so because of that we'll only publish these packages to internal package sources. | ||
|
||
See below for the installation instructions for each supported language: | ||
|
||
### Python | ||
|
||
The Python packages are published as wheels on the GitHub release. These can be installed directly. | ||
|
||
For a binary wheel with multiple target platforms like [algokit_transact](https://github.com/algorandfoundation/algokit-core/releases/tag/python%2Falgokit_transact%401.0.0-alpha.1), you can use the below config. | ||
|
||
```toml | ||
[tool.poetry.dependencies] | ||
algokit_transact = [ | ||
{ url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgokit_transact%401.0.0-alpha.1/algokit_transact-1.0.0a1-py3-none-macosx_10_12_x86_64.whl", markers = "sys_platform == 'darwin' and platform_machine == 'x86_64'" }, | ||
{ url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgokit_transact%401.0.0-alpha.1/algokit_transact-1.0.0a1-py3-none-macosx_11_0_arm64.whl", markers = "sys_platform == 'darwin' and platform_machine == 'arm64'" }, | ||
{ url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgokit_transact%401.0.0-alpha.1/algokit_transact-1.0.0a1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", markers = "sys_platform == 'linux' and platform_machine == 'x86_64'" }, | ||
{ url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgokit_transact%401.0.0-alpha.1/algokit_transact-1.0.0a1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", markers = "sys_platform == 'linux' and platform_machine == 'aarch64'" }, | ||
{ url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgokit_transact%401.0.0-alpha.1/algokit_transact-1.0.0a1-py3-none-win_amd64.whl", markers = "sys_platform == 'win32' and platform_machine == 'AMD64'" } | ||
] | ||
``` | ||
|
||
For a non binary wheel like [algod_api](https://github.com/algorandfoundation/algokit-core/releases/tag/python%2Falgod_api%401.0.0-alpha.2), you can use the below config. | ||
|
||
```toml | ||
[tool.poetry.dependencies] | ||
algokit_algod_api = { url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgod_api%401.0.0-alpha.2/algokit_algod_api-1.0.0a2-py3-none-any.whl" } | ||
``` | ||
|
||
### TypeScript | ||
|
||
The TypeScript packages are published to the GitHub packages NPM repository. | ||
|
||
For example [algokit_transact](https://github.com/algorandfoundation/algokit-core/pkgs/npm/algokit-transact). | ||
|
||
GitHub packages (the product) has some constaints, namely: | ||
|
||
- It requires authentication to install a package | ||
- It enforce packages scopes, which must match the GitHub username (`algorandfoundation` in our case). | ||
|
||
Unfortunately for us, the package scope in GitHub packages matches the official NPM registry and NPM itself does not support configuring multiple registries for a single package scope, so we need to be a little crafty when installing/updating the alpha packages we're installing from GitHub packages. | ||
|
||
To install, follow the below: | ||
|
||
1. Create a new [personal access token](https://github.com/settings/tokens/new) with `read:packages` permission and your preference of expiration time. | ||
2. Add the following to `~/.npmrc`: | ||
|
||
``` | ||
@algorandfoundation:registry=https://npm.pkg.github.com | ||
//npm.pkg.github.com/:_authToken={TOKEN} | ||
``` | ||
|
||
3. Install the package hosted in GitHub packages, which will update your NPM package lock file. | ||
|
||
``` | ||
npm install @algorandfoundation/[email protected] | ||
``` | ||
|
||
4. Remove `@algorandfoundation:registry=https://npm.pkg.github.com` from `~/.npmrc`, so NPM hosted `@algorandfoundation` packages can be resolved. | ||
|
||
Note: You will need to perform steps 2-4 each time your either install a package for the first time or update a GitHub package hosted dependency. Installing from the lock file only requires the token. | ||
neilcampbell marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.