From 6e2ed0b91723a754568549cc4a67b5ae49e496f7 Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Tue, 4 Jul 2023 14:50:42 +0200 Subject: [PATCH 01/12] Set-up doctests on CircleCI. --- .circleci/config.yml | 29 +++++++++++++++++++++++++++-- docs/source/requirements.txt | 3 ++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3076cbe6..c1d8be7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,10 +4,11 @@ workflows: version: 2 main: jobs: - - run_tests + - test-code + - test-docs jobs: - run_tests: + test-code: docker: - image: circleci/python:3.8 steps: @@ -39,3 +40,27 @@ jobs: - store_artifacts: path: test-reports + test-docs: + docker: + - image: circleci/python:3.8 + steps: + - checkout + - run: + name: Install requirements + command: | + python 3 -m venv venv + . venv/bin/activate + pip install -r requirements.txt + pip install -r docs/source/requirements.txt + + - run: + name: Build documentation + command: | + . venv/bin/activate + make -C docs html + + - run: + name: Run doctests + command: | + . venv/bin/activate + make -C docs doctest diff --git a/docs/source/requirements.txt b/docs/source/requirements.txt index 57a91900..3e764870 100644 --- a/docs/source/requirements.txt +++ b/docs/source/requirements.txt @@ -30,12 +30,13 @@ yahoo-fin==0.8.9.1 yfinance==0.2.20 # Develop -coverage==5.4 +coverage==7.2.7 docutils==0.16 # Docs hudsonthames-sphinx-theme==0.1.5 # Docs jinja2<3.1 # Docs pyarmor==8.2.5 # Encryption pylint==2.6.0 +pytest==7.3.1 releases==1.6.3 # Docs sphinx-rtd-theme==0.5.2 # Docs sphinx==3.4.3 # Docs From 51c8ff39e2cf12e4825850473a41d1a09bc008fc Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Tue, 4 Jul 2023 14:56:53 +0200 Subject: [PATCH 02/12] Fix typo. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c1d8be7c..a80dc918 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,7 @@ jobs: - run: name: Install requirements command: | - python 3 -m venv venv + python3 -m venv venv . venv/bin/activate pip install -r requirements.txt pip install -r docs/source/requirements.txt From 54450e3a8661ec82e884eec570859a30185f91b9 Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Tue, 4 Jul 2023 15:05:36 +0200 Subject: [PATCH 03/12] Switch on sphinx doctest. --- docs/source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 456664bb..b8676c93 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -34,8 +34,8 @@ 'sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.intersphinx', -# 'sphinx.ext.viewcode', - 'releases' + 'sphinx.ext.doctest', + 'releases', ] From 22d9842f30d0d7abae3cd8b509b8bdbb9c5df4ad Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Mon, 24 Jul 2023 14:45:03 +0200 Subject: [PATCH 04/12] Add custom mac interface option + updated install --- arbitragelab/util/segment.py | 7 +- docs/source/getting_started/installation.rst | 221 +++++++------------ tests/test_segment.py | 42 ++++ 3 files changed, 126 insertions(+), 144 deletions(-) create mode 100644 tests/test_segment.py diff --git a/arbitragelab/util/segment.py b/arbitragelab/util/segment.py index b09ceb6a..c39a8cbe 100644 --- a/arbitragelab/util/segment.py +++ b/arbitragelab/util/segment.py @@ -82,10 +82,13 @@ def get_mac(): """ Identify the device by MAC Address """ - mac = getmac.get_mac_address() + mac = getmac.get_mac_address(os.environ.get("ARBLAB_MAC_INTERFACE")) if mac is None: - raise Exception(" No MAC Address is found on this device, must have a MAC Address.") + raise ValueError("No MAC Address is found on this device, must have a MAC Address." + " If using a VPN, you might be able to resolve this by specifying" + " the correct interface manually using the PORTLAB_MAC_INTERFACE environment" + " variable.") return mac diff --git a/docs/source/getting_started/installation.rst b/docs/source/getting_started/installation.rst index b877786b..990b52ef 100644 --- a/docs/source/getting_started/installation.rst +++ b/docs/source/getting_started/installation.rst @@ -4,223 +4,160 @@ Installation ============ -Recommended Versions -#################### -* Anaconda -* Python 3.8. +API Keys +######## +In order to use ``arbitragelab``, you will require an API key. This is provided to +you when you purchase ArbitrageLab, and can be found on the client portal. If you are unable to find your API key, please reach out to sales@hudsonthames.org. -Installation -############ - -Ubuntu Linux -************ - -0. Set up Git (if you haven't already, the following `link `__ provides a nice guide.) -1. Make sure you install the latest version of the Anaconda distribution. To do this you can follow the install and update instructions found on this `link `_ -2. Launch a terminal -3. Create a New Conda Environment. From terminal. - - .. code-block:: - - conda create -n python=3.8 - - Accept all the requests to install. - -4. Now activate the environment with: +Recommended Setup on Windows +############################ - .. code-block:: - - source activate - -5. Contact Hudson & Thames sales team and purchase ArbitrageLab. You will be provided with an API key. +#. Download and install the latest version of `Anaconda 3 `__ +#. Launch Anaconda Navigator +#. Click Environments, choose an environment name, select Python 3.8, and click Create +#. Click Home, browse to your new environment, and click Install under Jupyter Notebook +#. Launch the Anaconda Prompt and activate the environment: .. code-block:: - Example: "26303adb02cb759b2" + conda activate -6. Install ArbitrageLab into your python environment via the terminal. - - Please make sure to use this exact statement: +#. Install ArbitrageLab using ``pip``: .. code-block:: pip install https://1fed2947109cfffdd6aaf615ea84a82be897c4b9@raw.githubusercontent.com/hudson-and-thames-clients/arbitragelab/master/arbitragelab-0.8.0-py38-none-any.whl -7. Add API key as an environment variable: - - 7.1 The Best Way: - - By adding the API key as an environment variable, you won't need to constantly add the key every time you import the library. - - * Open the terminal and run: ``sudo gedit /etc/environment`` - * This will open a text editor. - * Add the following environment variable: ``ARBLAB_API_KEY="26303adb02cb759b2"`` - * Note that you must add your own API key and not the one given in this example. - * Save the file and Logout or restart your computer. (If you skip this step, it won't register the change) - * To confirm your new env variable is active: ``echo $ARBLAB_API_KEY`` - - .. tip:: - - * If you are using Ubuntu on WSL (Windows Subsystem for Linux), then you should add this environment variable - to ~/.profile. Since you always load WSL from bash, this would make sure that the environment variable could - be loaded each time you start the virtual machine, which in turn ensured that Python can pick it up. +#. Make sure your API key is available in your environment under the ``ARBLAB_API_KEY`` environment variable by opening the Command Prompt as an administrator, and running the following command: - 7.2 The Easy Way: + .. code-block:: - If you don't want the key to persist on your local machine, you can always declare it each time, before you import ArbitrageLab. + setx ARBLAB_API_KEY "`__ provides a nice guide.) -1. Make sure you install the latest version of the Anaconda distribution. To do this you can follow the install and update instructions found on this `link `_ -2. Launch a terminal -3. Create a New Conda Environment. From terminal. + If you are running on Apple Silicon, you will need to make sure `Homebrew + `__ is installed, and that you have installed ``cmake``: .. code-block:: - conda create -n python=3.8 + brew install cmake + - Accept all the requests to install. -4. Now activate the environment with: +#. Install some variant of ``conda`` environment manager (we recommend Anaconda or Miniconda) for your platform. +#. Launch a new terminal and create a new ``conda`` environment using your environment manager: .. code-block:: - source activate + conda create -n python=3.8 -5. Contact Hudson & Thames sales team and purchase ArbitrageLab. You will be provided with an API key. +#. Make sure the environment is activated: .. code-block:: - Example: "26303adb02cb759b2" + conda activate -6. Install ArbitrageLab into your python environment via the terminal. - - Please make sure to use this exact statement: +#. Install ArbitrageLab using ``pip``: .. code-block:: pip install https://1fed2947109cfffdd6aaf615ea84a82be897c4b9@raw.githubusercontent.com/hudson-and-thames-clients/arbitragelab/master/arbitragelab-0.8.0-py38-none-any.whl -7. Add API key as an environment variable: - - 7.1 The Best Way: - - By adding the API key as an environment variable, you won't need to constantly add the key every time you import the library. - - * Open the terminal and run: ``sudo nano ~/.bash_profile``. This will open a text editor. - * Note: If there is no file named .bash_profile, then this above nano command will create a new file named .bash_profile. - * Add the following environment variable to the last line of the file: ``export ARBLAB_API_KEY="26303adb02cb759b2"`` - * Note that you must add your own API key and not the one given in this example. - * Press ctrl+X to exit the editor. Press ‘Y’ for saving the buffer, and you will return back to the terminal screen. - * Restart your computer. (If you skip this step, it won't register the change). The following may work to refresh your environment: ``source ~/.bash_profile`` - * To confirm your new env variable is active: ``echo $ARBLAB_API_KEY`` - - 7.2 The Easy Way: - - If you don't want the key to persist on your local machine, you can always declare it each time, before you import ArbitrageLab. +#. Make sure your API key is available in your environment under the ``ARBLAB_API_KEY`` environment variable. - * In your python script or notebook, add the following line before you import ArbitrageLab: + If you're running on **Linux or MacOS**, you can add the following to your + ``~/.zshrc``, ``~/.bashrc`` or ``~/.profile`` file in order to make the API + key available: - .. code:: - - import os - os.environ['ARBLAB_API_KEY'] = "426303b02cb7475984b2d4843" - import arbitragelab as al + .. code-block:: -.. tip:: + ARBLAB_API_KEY="" - * If you are having problems with the installation, please ping us on Slack and we will be able to assist. + where you replace ```_. - You can use this `installation guide `_. - -0. Set up Git (if you haven't already, the following `link `__ provides a nice guide.) -1. Download and install the latest version of `Anaconda 3 `__ -2. Launch Anaconda Prompt -3. Create new environment (replace with a name, for example ``arbitragelab``): + Verify that your API key is available in your environment by executing the following in your refreshed terminal .. code-block:: - conda create -n python=3.8 + echo $ARBLAB_API_KEY -4. Activate the new environment: + which should echo your API key to the terminal. - .. code-block:: - conda activate +#. You are now ready to use ArbitrageLab. -5. Contact Hudson & Thames sales team and purchase ArbitrageLab. You will be provided with an API key. - .. code-block:: +Google Colab +############ - Example: "26303adb02cb759b2d484233" +.. note:: -6. Install ArbitrageLab into your python environment via the terminal. + Google Colab frequently updates the version of Python it used. You might need to + explore additional methods of using a Python 3.8 kernel for full support of + ArbitrageLab. We are currently working on bring Python 3.9+ support. - Please make sure to use this exact statement: +#. Open a new Terminal, and install ArbitrageLab using ``pip``: .. code-block:: pip install https://1fed2947109cfffdd6aaf615ea84a82be897c4b9@raw.githubusercontent.com/hudson-and-thames-clients/arbitragelab/master/arbitragelab-0.8.0-py38-none-any.whl -7. Add API key as an environment variable: - 7.1 The Best Way: +#. Insert the following in the first cell of your notebook in order to register your API key - By adding the API key as an environment variable, you won't need to constantly add the key every time you import the library. +.. code-block:: python - * Open command prompt as an administrator. - * Create the variable: ``setx ARBLAB_API_KEY "26303adb02cb759b2"`` - * Note that you must add your own API key and not the one given in this example. - * Close and open a new command prompt - * Validate that your variable has been added: ``echo %ARBLAB_API_KEY%`` + # Insert this at the start of your script or notebook + import os - 7.2 The Easy Way: + os.environ["ARBLAB_API_KEY"] = "" - If you don't want the key to persist on your local machine, you can always declare it each time, before you import ArbitrageLab. - * In your python script or notebook, add the following line before you import ArbitrageLab: +Alternative ways of adding the API Key +###################################### + +.. warning:: - .. code:: + The following is not recommended for security reasons, since you run the risk + of accidentally leaking your API key in your source code by accidentally + committing it to your version control system. As a result, we highly + recommended using environment variables instead. - import os - os.environ['ARBLAB_API_KEY'] = "26303adb02cb759b2" - import arbitragelab as al +You can also use the ``os`` module in your Python script or Jupyter notebook +to add the ``ARBLAB_API_KEY`` environment variable before importing +``arbitragelab``: -.. tip:: +.. code-block:: python - * If you are having problems with the installation, please ping us on Slack and we will be able to assist. + # Insert this at the start of your script or notebook + import os -Important Notes -############### -* You may need to `install Cython `__ if your distribution hasn't already. -* ArbitrageLab requires an internet connection when you import the library. This checks that your API key is valid. -* We have added analytics to the library, please see the analytics tab for more details. + os.environ["ARBLAB_API_KEY"] = "" diff --git a/tests/test_segment.py b/tests/test_segment.py new file mode 100644 index 00000000..893a1997 --- /dev/null +++ b/tests/test_segment.py @@ -0,0 +1,42 @@ +"Tests for the `segment` module" + +# pylint: disbale=redefined-outer-name + +from unittest import mock + +import pytest + +from arbitragelab.util import segment + +@pytest.fixture +def mock_getmac(): + """Mock for the getmac dependency""" + with mock.patch("arbitragelab.util.segment.getmac") as mock_getmac: + yield mock_getmac + + +def test_get_mac_default_interface(mock_getmac): + """Test if we can get the MAC address for the default interface""" + mock_getmac.get_mac_address.return_value = "MAC_ADDRESS" + + actual_result = segment.get_mac() + expected_result = "MAC_ADDRESS" + assert actual_result == expected_result + mock_getmac.get_mac_address.assert_called_with(None) + +def test_get_mac_custom_interface(monkeypatch, mock_getmac): + """Test if we can get the MAC address for a custom interface""" + monkeypatch.setenv("ARBLAB_MAC_INTERFACE", "CUSTOM_INTERFACE") + mock_getmac.get_mac_address.return_value = "MAC_ADDRESS" + + actual_result = segment.get_mac() + expected_result = "MAC_ADDRESS" + assert actual_result == expected_result + mock_getmac.get_mac_address.assert_called_with("CUSTOM_INTERFACE") + +def test_get_mac_raises_error_if_no_mac_address_found(mock_getmac): # pylint: disable=invalid-name + """Test if get_mac raises an error if a MAC address cannot be found""" + mock_getmac.get_mac_address.return_value = None + + with pytest.raises(ValueError): + segment.get_mac() From ae68b69ba6097d969fbf685d504546898881e1d2 Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Mon, 24 Jul 2023 15:06:42 +0200 Subject: [PATCH 05/12] Update docs. --- docs/source/getting_started/installation.rst | 32 ++++++++++++++++++++ setup.py | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/source/getting_started/installation.rst b/docs/source/getting_started/installation.rst index 990b52ef..8a1ceae4 100644 --- a/docs/source/getting_started/installation.rst +++ b/docs/source/getting_started/installation.rst @@ -161,3 +161,35 @@ to add the ``ARBLAB_API_KEY`` environment variable before importing import os os.environ["ARBLAB_API_KEY"] = "" + + +Fixing "No MAC Address Found" Errors +#################################### + +Depending on your setup, especially when using a VPN service or application, +importing ``arbitragelab`` may cause a "No MAC Address Found" error to be +raised. This occurs when attempting to verify your API key, and occurs when we +are unable to access the MAC address of your computer's network device. This is +usually the result of a virtual network device, associated with your VPN, that +doesn't report a physical MAC address. + +The workaround is to manually specify your physical hardware network interface +name using another environment variable, ``ARBLAB_MAC_INTERFACE``: + +For Windows: + +.. code-block:: + + setx ARBLAB_MAC_INTERFACE "" + + +For Linux / MacOS: + +.. code-block:: + + # In ~/.bashrc, ~/.zshrc, or ~/.profile, depending on platform + ARBLAB_MAC_INTERFACE="" + + +With this environment variable set (remember to ``source`` your rc files if +you're on Linux or MacOS), you should now be able to import the package normally. diff --git a/setup.py b/setup.py index 1b71025d..6fcb91d3 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -# Copyright 2019, Hudson and Thames Quantitative Research +# Copyright 2023, Hudson and Thames Quantitative Research # All rights reserved # Read more: https://github.com/hudson-and-thames/arbitragtelab/blob/master/LICENSE.txt From f8588c84f00884427e34619b22252e615d82b6dc Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Mon, 24 Jul 2023 15:09:17 +0200 Subject: [PATCH 06/12] Update changelog. --- docs/source/changelog.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 5ff10742..dc4bcc66 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -9,8 +9,8 @@ Changelog * :feature:`50` Add a distutils command for marbles * :bug:`58` Fixed test failure on OSX -.. - For Help: https://releases.readthedocs.io/en/latest/index.html +* :support:`91` Allow user to specify network interface for MAC address + * :release:`0.8.0 <2022-06-28>` * :support:`78` Bump dependencies. From 7fdf6cfd4b304f07a3a0551bcbd32c8d6810c108 Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Mon, 24 Jul 2023 15:17:49 +0200 Subject: [PATCH 07/12] Fix disable comment. --- tests/test_segment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_segment.py b/tests/test_segment.py index 893a1997..4bdcc561 100644 --- a/tests/test_segment.py +++ b/tests/test_segment.py @@ -1,6 +1,6 @@ "Tests for the `segment` module" -# pylint: disbale=redefined-outer-name +# pylint: disable=redefined-outer-name from unittest import mock From 2ff34abb133aabe3b536a6bc2c9dda502eef92f9 Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Tue, 25 Jul 2023 14:58:09 +0200 Subject: [PATCH 08/12] Bump requirements. --- docs/source/requirements.txt | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/requirements.txt b/docs/source/requirements.txt index 3e764870..47e9ecdd 100644 --- a/docs/source/requirements.txt +++ b/docs/source/requirements.txt @@ -27,7 +27,7 @@ tensorflow-macos==2.12.0; sys_platform == 'darwin' and platform_machine == 'arm6 tensorflow==2.12.0; sys_platform != 'darwin' or platform_machine != 'arm64' werkzeug==2.2.3 yahoo-fin==0.8.9.1 -yfinance==0.2.20 +yfinance==0.2.24 # Develop coverage==7.2.7 diff --git a/requirements.txt b/requirements.txt index 3e764870..47e9ecdd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -27,7 +27,7 @@ tensorflow-macos==2.12.0; sys_platform == 'darwin' and platform_machine == 'arm6 tensorflow==2.12.0; sys_platform != 'darwin' or platform_machine != 'arm64' werkzeug==2.2.3 yahoo-fin==0.8.9.1 -yfinance==0.2.20 +yfinance==0.2.24 # Develop coverage==7.2.7 From 4c018611b5105c9015cb218b45243d3fee066dac Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Tue, 25 Jul 2023 15:45:31 +0200 Subject: [PATCH 09/12] Update README. --- .bumpversion.cfg | 6 +++-- README.md | 61 +++++++++++++++++++++++++++--------------------- 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index f1e38f02..913f9ada 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,9 +1,11 @@ [bumpversion] current_version = 0.8.0 -commit = True -tag = True +commit = False +tag = False tag_name = {new_version} [bumpversion:file:setup.cfg] [bumpversion:file:docs/source/conf.py] + +[bumpversion:file:obfuscate.sh] diff --git a/README.md b/README.md index eea95f0e..8e6c32f8 100644 --- a/README.md +++ b/README.md @@ -14,37 +14,44 @@ ArbitrageLab is a python library that enables traders who want to exploit mean-reverting portfolios by providing a complete set of algorithms from the best academic journals. -## Documentation, Example Notebooks and Lecture Videos -For every technique present in the library we not only provide extensive documentation, with both theoretical explanations -and detailed descriptions of available functions, but also supplement the modules with ever-growing array of lecture videos and slides -on the implemented methods. - -We want you to be able to use the tools right away. To achieve that, every module comes with a number of example notebooks -which include detailed examples of the usage of the algorithms. Our goal is to show you the whole pipeline, starting from -importing the libraries and ending with strategy performance metrics so you can get the added value from the get-go. -## Licensing options -This project is licensed under an all rights reserved [licence](https://github.com/hudson-and-thames/mlfinlab/blob/master/LICENSE.txt). +## Development -* Business -* Enterprise +### Creating a release -## Community -With the purchase of the library, our clients get access to the Hudson & Thames Slack community, where our engineers and other quants -are always ready to answer your questions. +- Create `release/` branch +- Bump versions throughout source files (we use `bump2version` to do automate this process, TODO: Add instructions) +- Update customer install instructions in documentation source files +- Update release information in changelog in documentation source files +- Open PR from `release` branch into `develop` +- Merge PR once approved +- Obfuscate `develop` using PyArmor (instructions are located elsewhere in this README) +- Test you can install the wheel from a fresh environment +- Merge `develop` into `master` +- Upload the obfuscated wheel to the Hudson & Thames Clients organization +- Tag the commit with the version number +- Write a blog post announcing the release +- Send a newsletter email +- Post on social media -Alternatively, you can email us at: research@hudsonthames.org. +### Bumping version numbers using `bump2version` - +We use `bump2version` to automatically bump versions throughout source files. + +Configuration lives in the `.bumpversion.cfg` file. To run `bump2version`, first install it via `pip`: + +``` sh +pip install --upgrade bump2version +``` + +And then bump the version: + +``` sh +bump2version +``` -## Who is Hudson & Thames? -Hudson and Thames Quantitative Research is a company with the goal of bridging the gap between the advanced research developed in -quantitative finance and its practical application. We have created three premium python libraries so you can effortlessly access the -latest techniques and focus on what matters most: **creating your own winning strategy**. +where `` tells you which version to be bumped. The acceptable +values are `major`, `minor` or `patch`, conforming to the semantic versioning +pattern: `major.minor.patch`. For example, `3.2.7` has a major version of 3, a +minor version of 2 and a patch version of 7. -### What was only possible with the help of huge R&D teams is now at your disposal, anywhere, anytime. From ff07dc584c5caf71f8afed6c27472577d5e7c883 Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Tue, 25 Jul 2023 15:46:11 +0200 Subject: [PATCH 10/12] Bump versions to 0.8.1 --- .bumpversion.cfg | 2 +- docs/source/conf.py | 2 +- obfuscate.sh | 40 ++++++++++++++++++++++++++++++++++++++++ setup.cfg | 4 ++-- 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100755 obfuscate.sh diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 913f9ada..dcb5f756 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.8.0 +current_version = 0.8.1 commit = False tag = False tag_name = {new_version} diff --git a/docs/source/conf.py b/docs/source/conf.py index b8676c93..62bb2cf2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,7 +22,7 @@ author = 'Hudson & Thames Quantitative Research' # The full version, including alpha/beta/rc tags -release = '0.8.0' +release = '0.8.1' # -- General configuration --------------------------------------------------- diff --git a/obfuscate.sh b/obfuscate.sh new file mode 100755 index 00000000..56e7c7ef --- /dev/null +++ b/obfuscate.sh @@ -0,0 +1,40 @@ +#! +# This script builds, unpacks, obfuscates, and then rebuilds the python wheel +# package + +# Set the version +# TODO: Do this automatically in the future by reading from setup.cfg (or +# similar) +VERSION=0.8.1 + +# Start clean +rm -rf dist/ + +# Build the wheel +python setup.py bdist_wheel + +# Unpack the wheel +python -m wheel unpack dist/arbitragelab-$VERSION-py3-none-any.whl --dest dist/ + +# Generate a PyArmor license +pyarmor-7 licenses c1_version # --expired 2024-02-01 c1_version <-- use this to make license expire + +# Obfuscate using PyArmor +pyarmor-7 obfuscate \ + --with-license licenses/c1_version/license.lic \ + --platform windows.x86_64 \ + --platform linux.x86_64 \ + --platform darwin.x86_64 \ + --platform darwin.aarch64 \ + --platform linux.x86 \ + --obf-code=0 \ + --recursive \ + --output dist/arbitragelab-$VERSION/arbitragelab arbitragelab/__init__.py + +# Repack wheel +python -m wheel pack dist/arbitragelab-$VERSION --dest dist + +# Clean-up +rm -rf dist/arbitragelab-$VERSION +rm -rf build +rm -rf licenses diff --git a/setup.cfg b/setup.cfg index 0e87bfb4..274fb090 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = arbitragelab -version = 0.8.0 +version = 0.8.1 author = Hudson and Thames Quantitative Research author_email = research@hudsonthames.org licence = All Rights Reserved @@ -50,7 +50,7 @@ install_requires = cvxpy==1.3.1 cython==0.29.28 dash==2.10.2 - getmac>=0.8.0, <1.0.0 + getmac>=0.8.1, <1.0.0 jupyter-dash>=0.2.0, <1.0.0 keras==2.12.0 lxml>=4.9.1 From 152ac46db5045bc5817e0f123d11a23b80fbcf84 Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Tue, 25 Jul 2023 15:46:48 +0200 Subject: [PATCH 11/12] Bump version in installation instructions. --- docs/source/getting_started/installation.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/getting_started/installation.rst b/docs/source/getting_started/installation.rst index 8a1ceae4..f38f26fe 100644 --- a/docs/source/getting_started/installation.rst +++ b/docs/source/getting_started/installation.rst @@ -27,7 +27,7 @@ Recommended Setup on Windows .. code-block:: - pip install https://1fed2947109cfffdd6aaf615ea84a82be897c4b9@raw.githubusercontent.com/hudson-and-thames-clients/arbitragelab/master/arbitragelab-0.8.0-py38-none-any.whl + pip install https://1fed2947109cfffdd6aaf615ea84a82be897c4b9@raw.githubusercontent.com/hudson-and-thames-clients/arbitragelab/master/arbitragelab-0.8.1-py38-none-any.whl #. Make sure your API key is available in your environment under the ``ARBLAB_API_KEY`` environment variable by opening the Command Prompt as an administrator, and running the following command: @@ -81,7 +81,7 @@ Recommended Setup on Linux / MacOS .. code-block:: - pip install https://1fed2947109cfffdd6aaf615ea84a82be897c4b9@raw.githubusercontent.com/hudson-and-thames-clients/arbitragelab/master/arbitragelab-0.8.0-py38-none-any.whl + pip install https://1fed2947109cfffdd6aaf615ea84a82be897c4b9@raw.githubusercontent.com/hudson-and-thames-clients/arbitragelab/master/arbitragelab-0.8.1-py38-none-any.whl #. Make sure your API key is available in your environment under the ``ARBLAB_API_KEY`` environment variable. @@ -128,7 +128,7 @@ Google Colab .. code-block:: - pip install https://1fed2947109cfffdd6aaf615ea84a82be897c4b9@raw.githubusercontent.com/hudson-and-thames-clients/arbitragelab/master/arbitragelab-0.8.0-py38-none-any.whl + pip install https://1fed2947109cfffdd6aaf615ea84a82be897c4b9@raw.githubusercontent.com/hudson-and-thames-clients/arbitragelab/master/arbitragelab-0.8.1-py38-none-any.whl #. Insert the following in the first cell of your notebook in order to register your API key From 71ef75bcfd281704351c6401be2325ab9eec7437 Mon Sep 17 00:00:00 2001 From: Michael Struwig Date: Tue, 25 Jul 2023 15:47:38 +0200 Subject: [PATCH 12/12] Update changelog. --- docs/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index dc4bcc66..7a187f71 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -9,6 +9,7 @@ Changelog * :feature:`50` Add a distutils command for marbles * :bug:`58` Fixed test failure on OSX +* :release:`0.8.1 <2022-07-25>` * :support:`91` Allow user to specify network interface for MAC address * :release:`0.8.0 <2022-06-28>`