-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
424a7f0
commit b1fd970
Showing
11 changed files
with
188 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: CI | ||
on: [ push, pull_request ] | ||
jobs: | ||
pytest: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v2 | ||
with: { python-version: '3.9' } | ||
- name: Install dependencies | ||
run: pip install tox | ||
- name: Run pytest | ||
run: tox -e pytest | ||
pylama: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v2 | ||
with: { python-version: '3.9' } | ||
- name: Install dependencies | ||
run: pip install tox | ||
- name: Run pylama | ||
run: tox -e pylama | ||
pyre: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v2 | ||
with: { python-version: '3.9' } | ||
- name: Install dependencies | ||
run: pip install tox | ||
- name: Run pyre | ||
run: tox -e pyre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Release | ||
on: { push: { tags: [ 'v*' ] } } | ||
jobs: | ||
github: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Create GitHub release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Update dependencies using pyup | ||
on: | ||
schedule: | ||
- cron: '30 8 * * *' | ||
push: | ||
branches: | ||
- main | ||
permissions: | ||
contents: write | ||
issues: read | ||
pull-requests: write | ||
jobs: | ||
pyup: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: { python-version: '3.9' } | ||
- name: Install pyup | ||
run: pip install git+https://github.com/DamianZaremba/pyup.git@gh-action-fixes | ||
- name: Run pyup | ||
run: pyup --provider=github --provider_url=https://api.github.com --integration --repo=${GITHUB_REPOSITORY} --branch=main --user-token=${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
update: all | ||
pin: True | ||
search: True | ||
close_prs: True | ||
requirements: | ||
- requirements.txt | ||
- dev-requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,20 @@ | ||
# continuous-trainer | ||
Scheduled training & comparison | ||
# ClueBot NG continuous trainer | ||
|
||
This repo trains the ANN on a schedule and compares the resulting database with the current production database. | ||
|
||
The intention is for it to serve as a step towards being able to safely re-train the database in the future. | ||
|
||
## Example Usage | ||
|
||
1. Download the reviewed edits | ||
1. `cbng-trainer download-edits --output=edits.xml` | ||
2. Train a new database | ||
1. `mkdir -p new/` | ||
1. `cbng-trainer build-database --input=edits.xml --output new/` | ||
3. Compare the 2 databases | ||
1. `cbng-trainer compare-database --target new/ --export results/` | ||
|
||
## Requirements | ||
|
||
1. Python 3.9+ | ||
2. Docker on execution host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
click | ||
aiohttp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[bdist_wheel] | ||
universal=1 | ||
|
||
[metadata] | ||
version = attr:trainer.__version__ | ||
|
||
[pylama:pycodestyle] | ||
max_line_length = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env python3 | ||
''' | ||
continuous-trainer - ClueBot NG continuous trainer | ||
MIT License | ||
Copyright (c) 2021 Damian Zaremba | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
''' | ||
from pathlib import Path | ||
|
||
import pkg_resources | ||
from setuptools import setup, find_packages | ||
|
||
with Path('README.md').open('r') as fh: | ||
long_description = fh.read() | ||
|
||
with Path('requirements.txt').open('r') as fh: | ||
install_requires = [str(req) for req in pkg_resources.parse_requirements(fh)] | ||
|
||
setup( | ||
name='cbng-trainer', | ||
description='ClueBot NG training utilities', | ||
long_description=long_description, | ||
long_description_content_type='text/markdown', | ||
url='https://github.com/cluebotng/trainer', | ||
packages=find_packages(), | ||
license='MIT', | ||
platforms='any', | ||
install_requires=install_requires, | ||
entry_points={ | ||
'console_scripts': [ | ||
'cbng-trainer=cbng_trainer.cli:cli' | ||
], | ||
}, | ||
classifiers=[ | ||
'Programming Language :: Python :: 3', | ||
'Operating System :: OS Independent', | ||
], | ||
python_requires='>=3.9', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[tox] | ||
envlist = pytest,pylama,pyre | ||
|
||
[testenv:pytest] | ||
deps = -r dev-requirements.txt | ||
-r requirements.txt | ||
commands = pytest tests | ||
|
||
[testenv:pylama] | ||
deps = -r dev-requirements.txt | ||
-r requirements.txt | ||
commands = pylama trainer | ||
|
||
[testenv:pyre] | ||
deps = -r dev-requirements.txt | ||
-r requirements.txt | ||
commands = pyre check |