Skip to content

Commit ac91d8d

Browse files
committed
first commit
0 parents  commit ac91d8d

177 files changed

Lines changed: 19590 additions & 0 deletions

File tree

Some content is hidden

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

.DS_Store

6 KB
Binary file not shown.

.circleci/config.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
version: 2.1
2+
3+
orbs:
4+
python: circleci/python@2.1.1
5+
python-lib: dialogue/python-lib@0.1.55
6+
# coveralls: coveralls/coveralls@1.0.6
7+
8+
jobs:
9+
black:
10+
resource_class: small
11+
parameters:
12+
python-version:
13+
type: string
14+
docker:
15+
- image: cimg/python:<< parameters.python-version >>
16+
17+
steps:
18+
- checkout
19+
20+
- restore_cache:
21+
name: Restore cached black venv
22+
keys:
23+
- v1-pypi-py-black-<< parameters.python-version >>
24+
25+
- run:
26+
name: Update & Activate black venv
27+
command: |
28+
python -m venv env/
29+
. env/bin/activate
30+
python -m pip install --upgrade pip
31+
pip install black
32+
33+
- save_cache:
34+
name: Save cached black venv
35+
paths:
36+
- "env/"
37+
key: v1-pypi-py-black-<< parameters.python-version >>
38+
39+
- run:
40+
name: Black format check
41+
command: |
42+
. env/bin/activate
43+
black --line-length 79 --exclude '(env|venv|.eggs)' --check .
44+
45+
pylint:
46+
resource_class: small
47+
parameters:
48+
python-version:
49+
type: string
50+
docker:
51+
- image: cimg/python:<< parameters.python-version >>
52+
53+
steps:
54+
- checkout
55+
56+
- run:
57+
name: Install Pylint
58+
command: |
59+
python -m venv env/
60+
. env/bin/activate
61+
pip install pylint
62+
63+
- run:
64+
name: Pylint check
65+
command: |
66+
. env/bin/activate
67+
pylint --fail-on=W,E,F --exit-zero ./
68+
69+
check_compatibility:
70+
parameters:
71+
python_version:
72+
type: string
73+
docker:
74+
- image: cimg/python:3.10
75+
steps:
76+
- checkout
77+
- run:
78+
name: Check if requirements files have changed
79+
command: ./scripts/check_requirements_changes.sh
80+
- run:
81+
name: Install dependencies and Check compatibility
82+
command: |
83+
if [ "$REQUIREMENTS_CHANGED" == "true" ]; then
84+
sudo apt-get update
85+
sudo apt-get install -y jq curl
86+
./scripts/check_compatibility.sh << parameters.python_version >>
87+
else
88+
echo "Skipping compatibility checks..."
89+
fi
90+
91+
build:
92+
resource_class: medium
93+
parallelism: 2
94+
parameters:
95+
python-version:
96+
type: string
97+
docker:
98+
- image: cimg/python:<< parameters.python-version >>
99+
100+
steps:
101+
- checkout
102+
103+
- restore_cache:
104+
name: Restore cached venv
105+
keys:
106+
- v1-pypi-py<< parameters.python-version >>-{{ checksum "requirements.txt" }}
107+
- v1-pypi-py<< parameters.python-version >>
108+
109+
- run:
110+
name: Update & Activate venv
111+
command: |
112+
python -m venv env/
113+
. env/bin/activate
114+
python -m pip install --upgrade pip
115+
116+
- save_cache:
117+
name: Save cached venv
118+
paths:
119+
- "env/"
120+
key: v1-pypi-py<< parameters.python-version >>-{{ checksum "requirements.txt" }}
121+
122+
- run:
123+
name: Install Bittensor Subnet Template
124+
command: |
125+
. env/bin/activate
126+
pip install -e .
127+
128+
- store_test_results:
129+
path: test-results
130+
- store_artifacts:
131+
path: test-results
132+
133+
coveralls:
134+
docker:
135+
- image: cimg/python:3.10
136+
steps:
137+
- run:
138+
name: Combine Coverage
139+
command: |
140+
pip3 install --upgrade coveralls
141+
coveralls --finish --rcfile .coveragerc || echo "Failed to upload coverage"
142+
143+
workflows:
144+
compatibility_checks:
145+
jobs:
146+
- check_compatibility:
147+
python_version: "3.8"
148+
name: check-compatibility-3.8
149+
- check_compatibility:
150+
python_version: "3.9"
151+
name: check-compatibility-3.9
152+
- check_compatibility:
153+
python_version: "3.10"
154+
name: check-compatibility-3.10
155+
- check_compatibility:
156+
python_version: "3.11"
157+
name: check-compatibility-3.11
158+
159+
pr-requirements:
160+
jobs:
161+
- black:
162+
python-version: "3.8.12"
163+
- pylint:
164+
python-version: "3.8.12"
165+
- build:
166+
matrix:
167+
parameters:
168+
python-version: ["3.9.13", "3.10.6", "3.11.4"]

.gitignore

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.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
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
private
86+
87+
# pyenv
88+
# For a library or package, you might want to ignore these files since the code is
89+
# intended to run in multiple environments; otherwise, check them in:
90+
# .python-version
91+
92+
# pipenv
93+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96+
# install all needed dependencies.
97+
#Pipfile.lock
98+
99+
# poetry
100+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
101+
# This is especially recommended for binary packages to ensure reproducibility, and is more
102+
# commonly ignored for libraries.
103+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
104+
#poetry.lock
105+
106+
# pdm
107+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
108+
#pdm.lock
109+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
110+
# in version control.
111+
# https://pdm.fming.dev/#use-with-ide
112+
.pdm.toml
113+
114+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115+
__pypackages__/
116+
117+
# Celery stuff
118+
celerybeat-schedule
119+
celerybeat.pid
120+
121+
# SageMath parsed files
122+
*.sage.py
123+
124+
# Environments
125+
.env
126+
.venv
127+
env/
128+
venv/
129+
ENV/
130+
env.bak/
131+
venv.bak/
132+
133+
# Spyder project settings
134+
.spyderproject
135+
.spyproject
136+
137+
# Rope project settings
138+
.ropeproject
139+
140+
# mkdocs documentation
141+
/site
142+
143+
# mypy
144+
.mypy_cache/
145+
.dmypy.json
146+
dmypy.json
147+
148+
# Pyre type checker
149+
.pyre/
150+
151+
# pytype static type analyzer
152+
.pytype/
153+
154+
# Cython debug symbols
155+
cython_debug/
156+
157+
*.key
158+
159+
# PyCharm
160+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162+
# and can be added to the global gitignore or merged into this file. For a more nuclear
163+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
164+
#.idea/
165+
166+
testing/

0 commit comments

Comments
 (0)