Skip to content

Commit 8c3d7e0

Browse files
author
Gal Ben David
committed
Replaced the C++ version with a Rust version
1 parent c6d3105 commit 8c3d7e0

Some content is hidden

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

80 files changed

+688
-44916
lines changed

.clang-format

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build
2+
on: [push, pull_request]
3+
jobs:
4+
lint:
5+
if: github.event_name == 'push' && !startsWith(github.event.ref, 'refs/tags')
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v2
10+
- name: Install latest rust
11+
uses: actions-rs/toolchain@v1
12+
with:
13+
toolchain: stable
14+
override: true
15+
components: clippy
16+
- name: Lint with clippy
17+
uses: actions-rs/cargo@v1
18+
with:
19+
command: clippy
20+
args: --all-targets --all-features
21+
test:
22+
runs-on: ${{ matrix.os }}
23+
needs: lint
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
python-version: [3.7, 3.8, 3.9]
28+
os: [ubuntu-latest , macos-latest, windows-latest]
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
- name: Run image
37+
uses: abatilo/[email protected]
38+
- name: Install Rust
39+
uses: actions-rs/toolchain@v1
40+
with:
41+
profile: minimal
42+
toolchain: stable
43+
override: true
44+
- name: Install dependencies
45+
run: poetry install
46+
- name: Build Python package
47+
run: poetry run maturin develop
48+
- name: Test
49+
run: poetry run pytest -Werror tests

.github/workflows/deploy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy
2+
on:
3+
release:
4+
types: [released]
5+
jobs:
6+
deploy:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
python-version: [3.7, 3.8, 3.9]
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install Rust
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
profile: minimal
24+
toolchain: stable
25+
override: true
26+
- name: Publish Package
27+
if: matrix.os != 'windows-latest'
28+
uses: messense/maturin-action@v1
29+
with:
30+
maturin-version: latest
31+
command: publish
32+
manylinux: 2014
33+
args: --username=__token__ --no-sdist --interpreter=python${{ matrix.python-version }}
34+
env:
35+
MATURIN_PASSWORD: ${{ secrets.pypi_password }}
36+
- name: Publish Package
37+
if: matrix.os == 'windows-latest'
38+
uses: messense/maturin-action@v1
39+
with:
40+
maturin-version: latest
41+
command: publish
42+
manylinux: 2014
43+
args: --username=__token__ --no-sdist --interpreter=python
44+
env:
45+
MATURIN_PASSWORD: ${{ secrets.pypi_password }}

.github/workflows/pythonpackage.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.gitignore

Lines changed: 57 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
33
*.py[cod]
4-
*$py.class
54

65
# C extensions
76
*.so
8-
97
# Distribution / packaging
108
.Python
9+
env/
1110
build/
1211
develop-eggs/
1312
dist/
@@ -19,36 +18,34 @@ lib64/
1918
parts/
2019
sdist/
2120
var/
22-
wheels/
23-
pip-wheel-metadata/
24-
share/python-wheels/
2521
*.egg-info/
2622
.installed.cfg
2723
*.egg
28-
MANIFEST
2924

3025
# PyInstaller
3126
# Usually these files are written by a python script from a template
3227
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3328
*.manifest
3429
*.spec
3530

31+
# conflict temp files
32+
*.py.orig
33+
*.mock
34+
3635
# Installer logs
3736
pip-log.txt
3837
pip-delete-this-directory.txt
3938

4039
# Unit test / coverage reports
4140
htmlcov/
41+
coverage_html_report/
4242
.tox/
43-
.nox/
4443
.coverage
4544
.coverage.*
4645
.cache
4746
nosetests.xml
4847
coverage.xml
49-
*.cover
50-
*.py,cover
51-
.hypothesis/
48+
*,cover
5249
.pytest_cache/
5350

5451
# Translations
@@ -57,77 +54,73 @@ coverage.xml
5754

5855
# Django stuff:
5956
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
7057

7158
# Sphinx documentation
7259
docs/_build/
7360

7461
# PyBuilder
7562
target/
7663

77-
# Jupyter Notebook
78-
.ipynb_checkpoints
64+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
7965

80-
# IPython
81-
profile_default/
82-
ipython_config.py
66+
*.iml
8367

84-
# pyenv
85-
.python-version
68+
## Directory-based project format:
69+
.idea/
8670

87-
# pipenv
88-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91-
# install all needed dependencies.
92-
#Pipfile.lock
71+
# Tests
72+
generic_tests.py
73+
cloudflare_test.py
9374

94-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95-
__pypackages__/
75+
############################
76+
#Eclipse Specific GitIgnore#
77+
############################
78+
*.pydevproject
79+
.project
80+
.metadata
81+
bin/**
82+
tmp/**
83+
tmp/**/*
84+
*.tmp
85+
*.bak
86+
*.swp
87+
*~.nib
88+
local.properties
89+
.classpath
90+
.settings/
91+
.loadpath
9692

97-
# Celery stuff
98-
celerybeat-schedule
99-
celerybeat.pid
10093

101-
# SageMath parsed files
102-
*.sage.py
94+
# Git mergetool traces
95+
*.orig
10396

104-
# Environments
105-
.env
106-
.venv
107-
env/
108-
venv/
109-
ENV/
110-
env.bak/
111-
venv.bak/
97+
# VS Code internal directory
98+
.vscode/
11299

113-
# Spyder project settings
114-
.spyderproject
115-
.spyproject
100+
*.dat
101+
*.code-workspace
102+
.history
116103

117-
# Rope project settings
118-
.ropeproject
104+
# Intsights development playground
105+
playground/
119106

120-
# mkdocs documentation
121-
/site
107+
pytest-report\.csv
108+
*.cppimporthash
109+
.rendered.*
110+
Databases.db
111+
112+
# Node.js
113+
dist/
114+
node_modules/
115+
coverage/
122116

123-
# mypy
124-
.mypy_cache/
125-
.dmypy.json
126-
dmypy.json
117+
# Generated by Cargo
118+
# will have compiled files and executables
119+
/target/
127120

128-
# Pyre type checker
129-
.pyre/
121+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
122+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
123+
Cargo.lock
130124

131-
*.cppimporthash
132-
.rendered.*
133-
.vscode
125+
# These are backup files generated by rustfmt
126+
**/*.rs.bk

0 commit comments

Comments
 (0)