Skip to content

Commit 44c8d39

Browse files
authored
Merge pull request #223 from nautechsystems/develop
Develop
2 parents abf4935 + 477accc commit 44c8d39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+312
-441
lines changed

.github/workflows/test-tag-publish.yml

+41-35
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
python-version: [ 3.9 ]
6969
name: test-tag-publish - Python ${{ matrix.python-version }} (${{ matrix.os }})
7070
runs-on: ${{ matrix.os }}
71+
outputs:
72+
upload_url: ${{ steps.create-release.outputs.upload_url }}
7173

7274
steps:
7375
- uses: actions/checkout@v2
@@ -109,22 +111,22 @@ jobs:
109111
version-command: poetry version --short
110112

111113
# Set release output variables
112-
- name: Set Output
114+
- name: Set output
113115
id: vars
114116
run: |
115-
echo ::set-output name=tag_name::${GITHUB_REF#refs/*/}
116-
echo ::set-output name=release_name::NautilusTrader ${GITHUB_REF#refs/*/} Beta
117+
echo "::set-output name=tag_name::v$(poetry version --short)"
118+
echo "::set-output name=release_name::NautilusTrader $(poetry version --short) Beta"
117119
118120
# Create GitHub release
119-
- name: Create Release
121+
- name: Create release
120122
id: create-release
121123
uses: actions/create-release@v1
122124
env:
123125
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124126
TAG_NAME: ${{ steps.vars.outputs.tag_name }}
125127
RELEASE_NAME: ${{ steps.vars.outputs.release_name }}
126128
with:
127-
tag_name: v${{ env.TAG_NAME }}
129+
tag_name: ${{ env.TAG_NAME }}
128130
release_name: ${{ env.RELEASE_NAME }}
129131
draft: false
130132
prerelease: false
@@ -174,31 +176,33 @@ jobs:
174176
poetry build --format sdist
175177
176178
# Set release output variables
177-
- name: Set Output
179+
- name: Set output
178180
id: vars
179181
run: |
180-
echo ::set-output name=release_url::https://github.com/nautechsystems/nautilus_trader/releases/tag/${GITHUB_REF#refs/*/}
182+
echo "::set-output name=asset_path::$(find ./dist -mindepth 1 -print -quit)"
183+
cd dist
184+
echo "::set-output name=asset_name::$(printf '%s\0' * | awk 'BEGIN{RS="\0"} {print; exit}')"
181185
182-
# Upload Release Asset
183-
- name: Upload Release Asset
186+
# Upload release asset
187+
- name: Upload release asset
184188
id: upload-release-asset
185189
uses: actions/upload-release-asset@v1
186190
env:
187191
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188-
RELEASE_URL: ${{ steps.vars.outputs.release_url }}
192+
ASSET_PATH: ${{ steps.vars.outputs.asset_path }}
193+
ASSET_NAME: ${{ steps.vars.outputs.asset_name }}
189194
with:
190-
upload_url: ${{ env.RELEASE_URL }}
191-
asset_path: find ./dist -mindepth 1 -print -quit
192-
asset_name: (cd dist/; printf '%s\0' * | awk 'BEGIN{RS="\0"} {print; exit}')
195+
upload_url: ${{ needs.tag_release.outputs.upload_url }}
196+
asset_path: ${{ env.ASSET_PATH }}
197+
asset_name: ${{ env.ASSET_NAME }}
193198
asset_content_type: application/zip
194199

195-
# TODO: Temporarily out of space on PyPI
196-
# # Publish
197-
# - name: Publish to production PyPI
198-
# env:
199-
# POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
200-
# POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
201-
# run: poetry publish
200+
# Publish
201+
- name: Publish to production PyPI
202+
env:
203+
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
204+
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
205+
run: poetry publish
202206

203207

204208
publish_wheels:
@@ -245,28 +249,30 @@ jobs:
245249
poetry build --format wheel
246250
247251
# Set release output variables
248-
- name: Set Output
252+
- name: Set output
249253
id: vars
250254
run: |
251-
echo ::set-output name=release_url::https://github.com/nautechsystems/nautilus_trader/releases/tag/${GITHUB_REF#refs/*/}
255+
echo "::set-output name=asset_path::$(find ./dist -mindepth 1 -print -quit)"
256+
cd dist
257+
echo "::set-output name=asset_name::$(printf '%s\0' * | awk 'BEGIN{RS="\0"} {print; exit}')"
252258
253-
# Upload Release Asset
254-
- name: Upload Release Asset
259+
# Upload release asset
260+
- name: Upload release asset
255261
id: upload-release-asset
256262
uses: actions/upload-release-asset@v1
257263
env:
258264
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
259-
RELEASE_URL: ${{ steps.vars.outputs.release_url }}
265+
ASSET_PATH: ${{ steps.vars.outputs.asset_path }}
266+
ASSET_NAME: ${{ steps.vars.outputs.asset_name }}
260267
with:
261-
upload_url: ${{ env.RELEASE_URL }}
262-
asset_path: find ./dist -mindepth 1 -print -quit
263-
asset_name: (cd dist/; printf '%s\0' * | awk 'BEGIN{RS="\0"} {print; exit}')
268+
upload_url: ${{ needs.tag_release.outputs.upload_url }}
269+
asset_path: ${{ env.ASSET_PATH }}
270+
asset_name: ${{ env.ASSET_NAME }}
264271
asset_content_type: application/wheel
265272

266-
# TODO: Temporarily out of space on PyPI
267-
# # Publish
268-
# - name: Publish to production PyPI
269-
# env:
270-
# POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
271-
# POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
272-
# run: poetry publish
273+
# Publish
274+
- name: Publish to production PyPI
275+
env:
276+
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
277+
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
278+
run: poetry publish

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ To install the latest binary wheel (or sdist package) from PyPI, run:
9292

9393
pip install -U nautilus_trader
9494

95+
#### From GitHub Release
96+
97+
To install a binary wheel from GitHub, first navigate to the latest release.
98+
99+
> https://github.com/nautechsystems/nautilus_trader/releases/latest/
100+
101+
Download the appropriate `.whl` for your operating system and Python version, then run:
102+
103+
pip install <file-name>.whl
104+
95105
#### From Source
96106

97107
Installation from source requires `rustc` and `cargo` to compile the Rust libraries,

build.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
##########################
5959

6060
RUST_LIBRARIES = {
61-
"nautilus-core": "lib/nautilus-core/target/release/libnautilus_core.a",
62-
"nautilus-model": "lib/nautilus-model/target/release/libnautilus_model.a",
61+
"nautilus-core": "lib/nautilus/target/release/libnautilus_core.a",
62+
"nautilus-model": "lib/nautilus/target/release/libnautilus_model.a",
6363
}
6464

6565
STATIC_LINK_MAP = {
@@ -73,10 +73,9 @@ def _build_rust_libs() -> None:
7373
# Build the Rust libraries using Cargo
7474
print("Building rust libs...")
7575

76-
for lib in RUST_LIBRARIES:
77-
cmd = f"(cd lib/{lib}; cargo build --release)"
78-
print(cmd)
79-
os.system(cmd)
76+
cmd = f"(cd lib/nautilus; cargo build --release)"
77+
print(cmd)
78+
os.system(cmd)
8079

8180

8281
def _build_extensions() -> List[Extension]:

lib/nautilus-core/README.md

-3
This file was deleted.

lib/nautilus-model/LICENSE

-165
This file was deleted.

lib/nautilus-model/README.md

-3
This file was deleted.

lib/nautilus/Cargo.toml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[workspace]
2+
members = [
3+
"core",
4+
"model",
5+
]
6+
7+
# Debug symbols end up chewing up several GB of disk space, so better to just
8+
# disable them.
9+
[profile.dev]
10+
debug = false
11+
[profile.test]
12+
debug = false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/nautilus-model/Cargo.toml lib/nautilus/model/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "nautilus_model"
2+
name = "nautilus-model"
33
version = "0.1.1"
44
authors = ["Nautech Systems <[email protected]>"]
55
edition = "2018"
@@ -10,6 +10,7 @@ crate-type = ["rlib", "staticlib"]
1010

1111
[dependencies]
1212
cbindgen = "0.17.0"
13+
nautilus-core = { path = "../core" }
1314

1415
[build-dependencies]
1516
cbindgen = "0.17.0"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)