quantplus 0.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- quantplus-0.0.4/.codecov.yml +10 -0
- quantplus-0.0.4/.coveragerc +13 -0
- quantplus-0.0.4/.flake8 +12 -0
- quantplus-0.0.4/.gitattributes +1 -0
- quantplus-0.0.4/.github/CONTRIBUTING.md +74 -0
- quantplus-0.0.4/.github/ISSUE_TEMPLATE.md +27 -0
- quantplus-0.0.4/.github/PULL_REQUEST_TEMPLATE.md +17 -0
- quantplus-0.0.4/.github/workflows/ci.yml +87 -0
- quantplus-0.0.4/.github/workflows/cibuildwheel.yml +87 -0
- quantplus-0.0.4/.github/workflows/docs.yml +68 -0
- quantplus-0.0.4/.github/workflows/flake8.yml +26 -0
- quantplus-0.0.4/.github/workflows/publish-pypi.yml +40 -0
- quantplus-0.0.4/.github/workflows/testing.yml +73 -0
- quantplus-0.0.4/.gitignore +82 -0
- quantplus-0.0.4/.isort.cfg +4 -0
- quantplus-0.0.4/.pre-commit-config.yaml +26 -0
- quantplus-0.0.4/AUTHORS.rst +13 -0
- quantplus-0.0.4/CONTRIBUTING.rst +103 -0
- quantplus-0.0.4/LICENSE +29 -0
- quantplus-0.0.4/MANIFEST.in +7 -0
- quantplus-0.0.4/PKG-INFO +54 -0
- quantplus-0.0.4/README.rst +21 -0
- quantplus-0.0.4/continuous_integration/scripts/editable_install.sh +12 -0
- quantplus-0.0.4/continuous_integration/scripts/install.sh +12 -0
- quantplus-0.0.4/continuous_integration/scripts/macos_install_eigen.sh +5 -0
- quantplus-0.0.4/continuous_integration/scripts/pre_build.sh +5 -0
- quantplus-0.0.4/docs/Makefile +20 -0
- quantplus-0.0.4/docs/make.bat +36 -0
- quantplus-0.0.4/docs/source/_static/.placeholder +0 -0
- quantplus-0.0.4/docs/source/conf.py +214 -0
- quantplus-0.0.4/docs/source/index.rst +15 -0
- quantplus-0.0.4/docs/source/installation.rst +7 -0
- quantplus-0.0.4/docs/source/min_versions.rst +28 -0
- quantplus-0.0.4/docs/source/release-history.rst +6 -0
- quantplus-0.0.4/docs/source/usage.rst +9 -0
- quantplus-0.0.4/examples/example.py +37 -0
- quantplus-0.0.4/pyproject.toml +71 -0
- quantplus-0.0.4/quantplus/__init__.py +24 -0
- quantplus-0.0.4/quantplus/_crr_pricer.cpp +10143 -0
- quantplus-0.0.4/quantplus/_crr_pricer.pyx +98 -0
- quantplus-0.0.4/quantplus/_version.py +24 -0
- quantplus-0.0.4/quantplus/csrc/crr_core.cpp +123 -0
- quantplus-0.0.4/quantplus/csrc/crr_core.h +25 -0
- quantplus-0.0.4/quantplus/tests/__init__.py +0 -0
- quantplus-0.0.4/quantplus/tests/test_quantplus.py +110 -0
- quantplus-0.0.4/quantplus.egg-info/PKG-INFO +54 -0
- quantplus-0.0.4/quantplus.egg-info/SOURCES.txt +55 -0
- quantplus-0.0.4/quantplus.egg-info/dependency_links.txt +1 -0
- quantplus-0.0.4/quantplus.egg-info/requires.txt +33 -0
- quantplus-0.0.4/quantplus.egg-info/scm_file_list.json +50 -0
- quantplus-0.0.4/quantplus.egg-info/scm_version.json +8 -0
- quantplus-0.0.4/quantplus.egg-info/top_level.txt +1 -0
- quantplus-0.0.4/requirements-dev.txt +20 -0
- quantplus-0.0.4/requirements.txt +17 -0
- quantplus-0.0.4/setup.cfg +14 -0
- quantplus-0.0.4/setup.py +40 -0
quantplus-0.0.4/.flake8
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
quantplus/_version.py export-subst
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
* Make sure you have a [GitHub account](https://github.com/signup/free)
|
|
6
|
+
* Submit a ticket for your issue, assuming one does not already exist.
|
|
7
|
+
* Clearly describe the issue including steps to reproduce when it is a bug.
|
|
8
|
+
* Make sure you fill in the earliest version that you know has the issue.
|
|
9
|
+
* Fork the repository on GitHub
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Making Changes
|
|
13
|
+
|
|
14
|
+
* Create a topic branch from where you want to base your work.
|
|
15
|
+
* This is usually the master branch.
|
|
16
|
+
* Only target release branches if you are certain your fix must be on that
|
|
17
|
+
branch.
|
|
18
|
+
* To quickly create a topic branch based on master; `git checkout -b
|
|
19
|
+
fix/master/my_contribution master`. Please avoid working directly on the
|
|
20
|
+
`master` branch.
|
|
21
|
+
* Make commits of logical units.
|
|
22
|
+
* Check for unnecessary whitespace with `git diff --check` before committing.
|
|
23
|
+
* Make sure your commit messages are in the proper format (see below)
|
|
24
|
+
* Make sure you have added the necessary tests for your changes.
|
|
25
|
+
* Run _all_ the tests to assure nothing else was accidentally broken.
|
|
26
|
+
|
|
27
|
+
### Writing the commit message
|
|
28
|
+
|
|
29
|
+
Commit messages should be clear and follow a few basic rules. Example:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
ENH: add functionality X to event_model.<submodule>.
|
|
33
|
+
|
|
34
|
+
The first line of the commit message starts with a capitalized acronym
|
|
35
|
+
(options listed below) indicating what type of commit this is. Then a blank
|
|
36
|
+
line, then more text if needed. Lines shouldn't be longer than 72
|
|
37
|
+
characters. If the commit is related to a ticket, indicate that with
|
|
38
|
+
"See #3456", "See ticket 3456", "Closes #3456" or similar.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Describing the motivation for a change, the nature of a bug for bug fixes
|
|
42
|
+
or some details on what an enhancement does are also good to include in a
|
|
43
|
+
commit message. Messages should be understandable without looking at the code
|
|
44
|
+
changes.
|
|
45
|
+
|
|
46
|
+
Standard acronyms to start the commit message with are:
|
|
47
|
+
```
|
|
48
|
+
API: an (incompatible) API change
|
|
49
|
+
BLD: change related to building numpy
|
|
50
|
+
BUG: bug fix
|
|
51
|
+
CI : continuous integration
|
|
52
|
+
DEP: deprecate something, or remove a deprecated object
|
|
53
|
+
DEV: development tool or utility
|
|
54
|
+
DOC: documentation
|
|
55
|
+
ENH: enhancement
|
|
56
|
+
MNT: maintenance commit (refactoring, typos, etc.)
|
|
57
|
+
REV: revert an earlier commit
|
|
58
|
+
STY: style fix (whitespace, PEP8)
|
|
59
|
+
TST: addition or modification of tests
|
|
60
|
+
REL: related to releases
|
|
61
|
+
```
|
|
62
|
+
## The Pull Request
|
|
63
|
+
|
|
64
|
+
* Now push to your fork
|
|
65
|
+
* Submit a [pull request](https://help.github.com/articles/using-pull-requests) to this branch. This is a start to the conversation.
|
|
66
|
+
|
|
67
|
+
At this point you're waiting on us. We like to at least comment on pull requests within three business days
|
|
68
|
+
(and, typically, one business day). We may suggest some changes or improvements or alternatives.
|
|
69
|
+
|
|
70
|
+
Hints to make the integration of your changes easy (and happen faster):
|
|
71
|
+
- Keep your pull requests small
|
|
72
|
+
- Don't forget your unit tests
|
|
73
|
+
- All algorithms need documentation, don't forget the .rst file
|
|
74
|
+
- Don't take changes requests to change your code personally
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!--- Provide a general summary of the issue in the Title above -->
|
|
2
|
+
|
|
3
|
+
## Expected Behavior
|
|
4
|
+
<!--- If you're describing a bug, tell us what should happen -->
|
|
5
|
+
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
|
6
|
+
|
|
7
|
+
## Current Behavior
|
|
8
|
+
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
|
9
|
+
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
|
10
|
+
|
|
11
|
+
## Possible Solution
|
|
12
|
+
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
|
13
|
+
<!--- or ideas how to implement the addition or change -->
|
|
14
|
+
|
|
15
|
+
## Steps to Reproduce (for bugs)
|
|
16
|
+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
|
17
|
+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
|
|
18
|
+
1.
|
|
19
|
+
2.
|
|
20
|
+
3.
|
|
21
|
+
|
|
22
|
+
## Context
|
|
23
|
+
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
|
24
|
+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
|
25
|
+
|
|
26
|
+
## Your Environment
|
|
27
|
+
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!--- Provide a general summary of your changes in the Title above -->
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
<!--- Describe your changes in detail -->
|
|
5
|
+
|
|
6
|
+
## Motivation and Context
|
|
7
|
+
<!--- Why is this change required? What problem does it solve? -->
|
|
8
|
+
<!--- If it fixes an open issue, please link to the issue here. -->
|
|
9
|
+
|
|
10
|
+
## How Has This Been Tested?
|
|
11
|
+
<!--- Please describe in detail how you tested your changes. -->
|
|
12
|
+
<!--- Include details of your testing environment, and the tests you ran to -->
|
|
13
|
+
<!--- see how your change affects other areas of the code, etc. -->
|
|
14
|
+
|
|
15
|
+
<!--
|
|
16
|
+
## Screenshots (if appropriate):
|
|
17
|
+
-->
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
schedule:
|
|
9
|
+
# Catch breakage from upstream Cython/setuptools/compiler updates
|
|
10
|
+
# even if nobody pushes for a while.
|
|
11
|
+
- cron: "0 6 * * 1"
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
test:
|
|
19
|
+
name: test (${{ matrix.os }}, py${{ matrix.python-version }})
|
|
20
|
+
runs-on: ${{ matrix.os }}
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
25
|
+
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0 # full history/tags, needed by setuptools_scm
|
|
31
|
+
|
|
32
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
33
|
+
uses: actions/setup-python@v5
|
|
34
|
+
with:
|
|
35
|
+
python-version: ${{ matrix.python-version }}
|
|
36
|
+
|
|
37
|
+
- name: Install build + test dependencies
|
|
38
|
+
run: |
|
|
39
|
+
python -m pip install --upgrade pip
|
|
40
|
+
pip install -r requirements-dev.txt
|
|
41
|
+
|
|
42
|
+
- name: Build and install (editable)
|
|
43
|
+
run: pip install -e . --no-build-isolation
|
|
44
|
+
|
|
45
|
+
- name: Run tests with coverage
|
|
46
|
+
run: pytest --cov=quantplus --cov-report=term-missing --cov-report=xml
|
|
47
|
+
|
|
48
|
+
- name: Upload coverage to Codecov
|
|
49
|
+
uses: codecov/codecov-action@v4
|
|
50
|
+
with:
|
|
51
|
+
files: ./coverage.xml
|
|
52
|
+
fail_ci_if_error: false
|
|
53
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
54
|
+
|
|
55
|
+
lint:
|
|
56
|
+
name: lint
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v4
|
|
60
|
+
- uses: actions/setup-python@v5
|
|
61
|
+
with:
|
|
62
|
+
python-version: "3.12"
|
|
63
|
+
- name: Install lint tools
|
|
64
|
+
run: pip install flake8 black isort cython-lint
|
|
65
|
+
- name: flake8
|
|
66
|
+
run: flake8 quantplus examples
|
|
67
|
+
- name: black --check
|
|
68
|
+
run: black --check quantplus examples
|
|
69
|
+
- name: cython-lint
|
|
70
|
+
run: cython-lint quantplus/*.pyx
|
|
71
|
+
|
|
72
|
+
build-sdist:
|
|
73
|
+
name: build sdist (packaging sanity check)
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v4
|
|
77
|
+
with:
|
|
78
|
+
fetch-depth: 0
|
|
79
|
+
- uses: actions/setup-python@v5
|
|
80
|
+
with:
|
|
81
|
+
python-version: "3.12"
|
|
82
|
+
- run: pip install build
|
|
83
|
+
- run: python -m build --sdist
|
|
84
|
+
- uses: actions/upload-artifact@v4
|
|
85
|
+
with:
|
|
86
|
+
name: sdist
|
|
87
|
+
path: dist/*.tar.gz
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# This workflow will upload a Python Package using flit when a release is
|
|
2
|
+
# created. For more information see:
|
|
3
|
+
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
|
4
|
+
|
|
5
|
+
name: cibuildwheel
|
|
6
|
+
|
|
7
|
+
# Build on every branch push, tag push, and pull request change:
|
|
8
|
+
on:
|
|
9
|
+
release:
|
|
10
|
+
types:
|
|
11
|
+
- created
|
|
12
|
+
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
|
|
13
|
+
# on:
|
|
14
|
+
# push:
|
|
15
|
+
# pull_request:
|
|
16
|
+
# release:
|
|
17
|
+
# types:
|
|
18
|
+
# - published
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
build_wheels:
|
|
22
|
+
name: Build wheels on ${{ matrix.os }}
|
|
23
|
+
runs-on: ${{ matrix.os }}
|
|
24
|
+
strategy:
|
|
25
|
+
matrix:
|
|
26
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- name: Build wheels
|
|
31
|
+
uses: pypa/cibuildwheel@v2.19.2
|
|
32
|
+
env:
|
|
33
|
+
# 1. Skip all PyPy builds (pp*)
|
|
34
|
+
CIBW_SKIP: "pp*"
|
|
35
|
+
|
|
36
|
+
# 2. Build only standard 64-bit architectures (avoids 32-bit i686 compiler errors)
|
|
37
|
+
CIBW_ARCHS: "auto64"
|
|
38
|
+
|
|
39
|
+
# 3 Builds both Intel and Apple Silicon wheels on the macos-latest runner:
|
|
40
|
+
CIBW_ARCHS_MACOS: "x86_64 arm64"
|
|
41
|
+
|
|
42
|
+
# 4. (Optional) Increase verbosity if you want to see detailed compiler output
|
|
43
|
+
CIBW_BUILD_VERBOSITY: 1
|
|
44
|
+
|
|
45
|
+
- uses: actions/upload-artifact@v4
|
|
46
|
+
with:
|
|
47
|
+
name: python-wheels-${{ matrix.os }}
|
|
48
|
+
path: ./wheelhouse/*.whl
|
|
49
|
+
|
|
50
|
+
build_sdist:
|
|
51
|
+
name: Build source distribution
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@v4
|
|
55
|
+
|
|
56
|
+
- name: Build sdist
|
|
57
|
+
run: pipx run build --sdist
|
|
58
|
+
|
|
59
|
+
- uses: actions/upload-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
name: python-sdist
|
|
62
|
+
path: dist/*.tar.gz
|
|
63
|
+
|
|
64
|
+
upload_pypi:
|
|
65
|
+
needs: [build_wheels, build_sdist]
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
# upload to PyPI on every tag starting with 'v'
|
|
68
|
+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
69
|
+
# alternatively, to publish when a GitHub Release is created, use the following rule:
|
|
70
|
+
# if: github.event_name == 'release' && github.event.action == 'published'
|
|
71
|
+
if: github.event_name == 'release' && github.event.action == 'created'
|
|
72
|
+
|
|
73
|
+
steps:
|
|
74
|
+
- uses: actions/download-artifact@v4
|
|
75
|
+
with:
|
|
76
|
+
# unpacks default artifact into dist/
|
|
77
|
+
# if `name: artifact` is omitted, the action will create extra parent dir
|
|
78
|
+
path: dist
|
|
79
|
+
merge-multiple: true
|
|
80
|
+
- name: Display structure of downloaded files
|
|
81
|
+
run: ls -R
|
|
82
|
+
|
|
83
|
+
- uses: pypa/gh-action-pypi-publish@v1.5.0
|
|
84
|
+
with:
|
|
85
|
+
user: __token__
|
|
86
|
+
password: ${{ secrets.PYPI_API_TOKEN_QUANTPLUS }}
|
|
87
|
+
# To test: repository_url: https://test.pypi.org/legacy/
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
name: Docs on github page
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
publish-docs:
|
|
8
|
+
name: Build and publish docs
|
|
9
|
+
runs-on: ubuntu-22.04
|
|
10
|
+
strategy:
|
|
11
|
+
matrix:
|
|
12
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
13
|
+
fail-fast: false
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v2
|
|
17
|
+
|
|
18
|
+
- name: Set environment variable
|
|
19
|
+
run: |
|
|
20
|
+
export REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} # just the repo, as opposed to org/repo
|
|
21
|
+
echo "REPOSITORY_NAME=${REPOSITORY_NAME}" >> $GITHUB_ENV
|
|
22
|
+
- name: Dependencies C++
|
|
23
|
+
run: |
|
|
24
|
+
sudo apt-get update
|
|
25
|
+
sudo apt-get install git build-essential cmake libeigen3-dev valgrind
|
|
26
|
+
sudo ln -s /usr/include/eigen3/Eigen /usr/include/Eigen
|
|
27
|
+
ls /usr/include
|
|
28
|
+
- name: Set up Python ${{ matrix.python-version }} with conda
|
|
29
|
+
uses: conda-incubator/setup-miniconda@v2
|
|
30
|
+
with:
|
|
31
|
+
activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }}
|
|
32
|
+
auto-update-conda: true
|
|
33
|
+
miniconda-version: "latest"
|
|
34
|
+
python-version: ${{ matrix.python-version }}
|
|
35
|
+
|
|
36
|
+
- name: Install
|
|
37
|
+
shell: bash -l {0}
|
|
38
|
+
run: source continuous_integration/scripts/install.sh
|
|
39
|
+
|
|
40
|
+
- name: Build example code
|
|
41
|
+
shell: 'script --return --quiet --command "bash -l {0}"'
|
|
42
|
+
run: |
|
|
43
|
+
set -vxeo pipefail
|
|
44
|
+
conda env list
|
|
45
|
+
conda install pandoc
|
|
46
|
+
# Why pandoc need to be installed by conda
|
|
47
|
+
# https://stackoverflow.com/a/71585691/10642305
|
|
48
|
+
pip install -r requirements.txt
|
|
49
|
+
|
|
50
|
+
- name: Build docs
|
|
51
|
+
shell: bash -l {0}
|
|
52
|
+
run: make -C docs html
|
|
53
|
+
|
|
54
|
+
- name: Publish docs
|
|
55
|
+
# We pin to the SHA, not the tag, for security reasons.
|
|
56
|
+
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
|
|
57
|
+
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.python-version == '3.8' }}
|
|
58
|
+
if: ${{ github.repository_owner == 'ke-zhang-rd' && github.ref_name == 'main' && matrix.python-version == '3.13' }}
|
|
59
|
+
# uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
|
|
60
|
+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
|
|
61
|
+
with:
|
|
62
|
+
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY}}
|
|
63
|
+
publish_branch: gh-pages
|
|
64
|
+
publish_dir: ./docs/build/html
|
|
65
|
+
external_repository: ke-zhang-rd/ke-zhang-rd.github.io
|
|
66
|
+
destination_dir: ${{ env.REPOSITORY_NAME }}
|
|
67
|
+
keep_files: true # Keep old files.
|
|
68
|
+
force_orphan: false # Keep git history.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Flake8 Code Style
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
lint:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
fail-fast: false
|
|
10
|
+
steps:
|
|
11
|
+
|
|
12
|
+
- uses: actions/checkout@v2
|
|
13
|
+
|
|
14
|
+
- uses: actions/setup-python@v2
|
|
15
|
+
|
|
16
|
+
- name: Install flake8
|
|
17
|
+
shell: bash -l {0}
|
|
18
|
+
run: |
|
|
19
|
+
set -vxeuo pipefail
|
|
20
|
+
python -m pip install --upgrade pip
|
|
21
|
+
python -m pip install flake8
|
|
22
|
+
python -m pip list
|
|
23
|
+
|
|
24
|
+
- name: Run flake8
|
|
25
|
+
shell: bash -l {0}
|
|
26
|
+
run: flake8
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# This workflow will upload a Python Package using flit when a release is
|
|
2
|
+
# created. For more information see:
|
|
3
|
+
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
|
4
|
+
|
|
5
|
+
name: Pypi Upload
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
release:
|
|
9
|
+
types: [created]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
deploy:
|
|
13
|
+
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v2
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
uses: actions/setup-python@v2
|
|
20
|
+
with:
|
|
21
|
+
python-version: '3.x'
|
|
22
|
+
- name: Dependencies C++
|
|
23
|
+
run: |
|
|
24
|
+
sudo apt-get update
|
|
25
|
+
sudo apt-get install git build-essential cmake libeigen3-dev valgrind
|
|
26
|
+
sudo ln -s /usr/include/eigen3/Eigen /usr/include/Eigen
|
|
27
|
+
ls /usr/include
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip setuptools twine wheel numpy cython
|
|
31
|
+
|
|
32
|
+
- name: Build and publish
|
|
33
|
+
env:
|
|
34
|
+
TWINE_USERNAME: __token__
|
|
35
|
+
# The PYPI_PASSWORD must be a pypi token with the "pypi-" prefix with sufficient permissions to upload this package
|
|
36
|
+
# https://pypi.org/help/#apitoken
|
|
37
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_QUANTPLUS}}
|
|
38
|
+
run: |
|
|
39
|
+
python setup.py sdist bdist_wheel
|
|
40
|
+
twine upload dist/*
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: Unit Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: '00 4 * * *' # daily at 4AM
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
16
|
+
# We still test against jsonschema 2.x because pip's dependency resolver
|
|
17
|
+
# very often gives us 2.x even though we ask for 3.x. The event-model
|
|
18
|
+
# code has codepaths for either, conditional on what is installed.
|
|
19
|
+
# See https://github.com/bluesky/event-model/pull/175 and
|
|
20
|
+
# https://github.com/bluesky/event-model/issues/145 for more context.
|
|
21
|
+
jsonschema-version: [0, 1, 2]
|
|
22
|
+
fail-fast: false
|
|
23
|
+
steps:
|
|
24
|
+
|
|
25
|
+
- uses: actions/checkout@v2
|
|
26
|
+
|
|
27
|
+
- name: Set environment variable
|
|
28
|
+
run: |
|
|
29
|
+
export REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} # just the repo, as opposed to org/repo
|
|
30
|
+
echo "REPOSITORY_NAME=${REPOSITORY_NAME}" >> $GITHUB_ENV
|
|
31
|
+
|
|
32
|
+
- name: Dependencies C++
|
|
33
|
+
run: |
|
|
34
|
+
sudo apt-get update
|
|
35
|
+
sudo apt-get install git build-essential cmake libeigen3-dev valgrind
|
|
36
|
+
sudo ln -s /usr/include/eigen3/Eigen /usr/include/Eigen
|
|
37
|
+
ls /usr/include
|
|
38
|
+
|
|
39
|
+
# - name: Set up Python ${{ matrix.python-version }}
|
|
40
|
+
# uses: actions/setup-python@v2
|
|
41
|
+
# with:
|
|
42
|
+
# python-version: ${{ matrix.python-version }}
|
|
43
|
+
|
|
44
|
+
- name: Set up Python ${{ matrix.python-version }} with conda
|
|
45
|
+
uses: conda-incubator/setup-miniconda@v2
|
|
46
|
+
with:
|
|
47
|
+
activate-environment: ${{ env.REPOSITORY_NAME }}-py${{ matrix.python-version }}
|
|
48
|
+
auto-update-conda: true
|
|
49
|
+
miniconda-version: "latest"
|
|
50
|
+
python-version: ${{ matrix.python-version }}
|
|
51
|
+
|
|
52
|
+
- name: Install Python dependencies
|
|
53
|
+
shell: bash -l {0}
|
|
54
|
+
run: python -m pip install Cython
|
|
55
|
+
- name: Install
|
|
56
|
+
shell: bash -l {0}
|
|
57
|
+
run: source continuous_integration/scripts/editable_install.sh
|
|
58
|
+
# Looks only editable install could make pytest and cython extension build work together
|
|
59
|
+
# https://stackoverflow.com/questions/48330471/running-pytest-with-cython-how-to-compile-cython-modules-in-pytest
|
|
60
|
+
|
|
61
|
+
- name: Install test requirements
|
|
62
|
+
shell: bash -l {0}
|
|
63
|
+
run: |
|
|
64
|
+
set -vxeuo pipefail
|
|
65
|
+
pip install -r requirements-dev.txt
|
|
66
|
+
pip list
|
|
67
|
+
|
|
68
|
+
- name: Test with pytest
|
|
69
|
+
shell: bash -l {0}
|
|
70
|
+
run: |
|
|
71
|
+
set -vxeuo pipefail
|
|
72
|
+
coverage run -m pytest -v
|
|
73
|
+
coverage report
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
env/
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
venv/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
|
|
28
|
+
# PyInstaller
|
|
29
|
+
# Usually these files are written by a python script from a template
|
|
30
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*,cover
|
|
47
|
+
.hypothesis/
|
|
48
|
+
|
|
49
|
+
# Translations
|
|
50
|
+
*.mo
|
|
51
|
+
*.pot
|
|
52
|
+
|
|
53
|
+
# Django stuff:
|
|
54
|
+
*.log
|
|
55
|
+
|
|
56
|
+
# Sphinx documentation
|
|
57
|
+
docs/build/
|
|
58
|
+
docs/source/generated/
|
|
59
|
+
|
|
60
|
+
# pytest
|
|
61
|
+
.pytest_cache/
|
|
62
|
+
|
|
63
|
+
# PyBuilder
|
|
64
|
+
target/
|
|
65
|
+
|
|
66
|
+
# Editor files
|
|
67
|
+
# mac
|
|
68
|
+
.DS_Store
|
|
69
|
+
*~
|
|
70
|
+
|
|
71
|
+
# vim
|
|
72
|
+
*.swp
|
|
73
|
+
*.swo
|
|
74
|
+
|
|
75
|
+
# pycharm
|
|
76
|
+
.idea/
|
|
77
|
+
|
|
78
|
+
# VSCode
|
|
79
|
+
.vscode/
|
|
80
|
+
|
|
81
|
+
# Ipython Notebook
|
|
82
|
+
.ipynb_checkpoints
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
default_language_version:
|
|
2
|
+
python: python3
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v4.4.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: end-of-file-fixer
|
|
9
|
+
- id: trailing-whitespace
|
|
10
|
+
- repo: https://github.com/ambv/black
|
|
11
|
+
rev: 23.3.0
|
|
12
|
+
hooks:
|
|
13
|
+
- id: black
|
|
14
|
+
- repo: https://github.com/pycqa/flake8
|
|
15
|
+
rev: 6.0.0
|
|
16
|
+
hooks:
|
|
17
|
+
- id: flake8
|
|
18
|
+
- repo: https://github.com/pycqa/isort
|
|
19
|
+
rev: 5.12.0
|
|
20
|
+
hooks:
|
|
21
|
+
- id: isort
|
|
22
|
+
args: ["--profile", "black"]
|
|
23
|
+
- repo: https://github.com/kynan/nbstripout
|
|
24
|
+
rev: 0.6.1
|
|
25
|
+
hooks:
|
|
26
|
+
- id: nbstripout
|