mirror of
https://github.com/OpenJarbas/PySychonaut.git
synced 2025-04-21 23:37:52 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c9053d7525 | ||
![]() |
b3cc888c71 | ||
![]() |
98c3ff5936 | ||
![]() |
52222d565c | ||
![]() |
deba6212ea | ||
![]() |
9ab72ad257 |
33
.github/workflows/build_tests.yml
vendored
Normal file
33
.github/workflows/build_tests.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: Run Build Tests
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.8
|
||||||
|
- name: Install Build Tools
|
||||||
|
run: |
|
||||||
|
python -m pip install build wheel
|
||||||
|
- name: Install System Dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt install python3-dev swig libssl-dev libfann-dev portaudio19-dev libpulse-dev
|
||||||
|
- name: Build Distribution Packages
|
||||||
|
run: |
|
||||||
|
python setup.py bdist_wheel
|
||||||
|
- name: Install tflite_runtime workaround tflit bug
|
||||||
|
run: |
|
||||||
|
pip3 install numpy
|
||||||
|
pip3 install --extra-index-url https://google-coral.github.io/py-repo/ tflite_runtime
|
||||||
|
- name: Install core repo
|
||||||
|
run: |
|
||||||
|
pip install .[audio-backend,mark1,stt,tts,skills_minimal,skills,gui,bus,all]
|
35
.github/workflows/license_tests.yml
vendored
Normal file
35
.github/workflows/license_tests.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
name: Run License Tests
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
license_tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.8
|
||||||
|
- name: Install Build Tools
|
||||||
|
run: |
|
||||||
|
python -m pip install build wheel
|
||||||
|
- name: Install System Dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt install python3-dev swig libssl-dev
|
||||||
|
- name: Install core repo
|
||||||
|
run: |
|
||||||
|
pip install .
|
||||||
|
- name: Install licheck
|
||||||
|
run: |
|
||||||
|
pip install git+https://github.com/NeonJarbas/lichecker
|
||||||
|
- name: Install test dependencies
|
||||||
|
run: |
|
||||||
|
pip install pytest pytest-timeout pytest-cov
|
||||||
|
- name: Test Licenses
|
||||||
|
run: |
|
||||||
|
pytest test/license_tests.py
|
@ -470,6 +470,8 @@ class AskTheCaterpillar:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def ask_the_caterpillar(query):
|
def ask_the_caterpillar(query):
|
||||||
data = requests.post('https://www.askthecaterpillar.com/query', {"query": query})
|
data = requests.post('https://www.askthecaterpillar.com/query', {"query": query})
|
||||||
data = json.loads(data.text)
|
if data.status_code == 200:
|
||||||
return data["data"]["messages"][0]["content"]
|
data = json.loads(data.text)
|
||||||
|
return data["data"]["messages"][0]["content"]
|
||||||
|
else:
|
||||||
|
return f"Error {r.status_code}: {r.reason}"
|
2
setup.py
2
setup.py
@ -9,5 +9,5 @@ setup(
|
|||||||
author='jarbasAI',
|
author='jarbasAI',
|
||||||
author_email='jarbasai@mailfence.com',
|
author_email='jarbasai@mailfence.com',
|
||||||
description='unnoficial erowid, psychonaut wiki and ask_the_caterpillar apis',
|
description='unnoficial erowid, psychonaut wiki and ask_the_caterpillar apis',
|
||||||
install_requires=["lxml", "bs4", "requests"]
|
install_requires=["lxml", "beautifulsoup4", "requests"]
|
||||||
)
|
)
|
||||||
|
55
test/license_tests.py
Normal file
55
test/license_tests.py
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import unittest
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
from lichecker import LicenseChecker
|
||||||
|
|
||||||
|
# these packages dont define license in setup.py
|
||||||
|
# manually verified and injected
|
||||||
|
license_overrides = {
|
||||||
|
"kthread": "MIT",
|
||||||
|
'yt-dlp': "Unlicense",
|
||||||
|
'pyxdg': 'GPL-2.0',
|
||||||
|
'ptyprocess': 'ISC license',
|
||||||
|
'psutil': 'BSD3'
|
||||||
|
}
|
||||||
|
# explicitly allow these packages that would fail otherwise
|
||||||
|
whitelist = [
|
||||||
|
'idna' # BSD-like
|
||||||
|
]
|
||||||
|
|
||||||
|
# validation flags
|
||||||
|
allow_nonfree = False
|
||||||
|
allow_viral = False
|
||||||
|
allow_unknown = False
|
||||||
|
allow_unlicense = True
|
||||||
|
allow_ambiguous = False
|
||||||
|
|
||||||
|
pkg_name = "PySychonaut"
|
||||||
|
|
||||||
|
|
||||||
|
class TestLicensing(unittest.TestCase):
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(self):
|
||||||
|
licheck = LicenseChecker(pkg_name,
|
||||||
|
license_overrides=license_overrides,
|
||||||
|
whitelisted_packages=whitelist,
|
||||||
|
allow_ambiguous=allow_ambiguous,
|
||||||
|
allow_unlicense=allow_unlicense,
|
||||||
|
allow_unknown=allow_unknown,
|
||||||
|
allow_viral=allow_viral,
|
||||||
|
allow_nonfree=allow_nonfree)
|
||||||
|
print("Package", pkg_name)
|
||||||
|
print("Version", licheck.version)
|
||||||
|
print("License", licheck.license)
|
||||||
|
print("Transient Requirements (dependencies of dependencies)")
|
||||||
|
pprint(licheck.transient_dependencies)
|
||||||
|
self.licheck = licheck
|
||||||
|
|
||||||
|
def test_license_compliance(self):
|
||||||
|
print("Package Versions")
|
||||||
|
pprint(self.licheck.versions)
|
||||||
|
|
||||||
|
print("Dependency Licenses")
|
||||||
|
pprint(self.licheck.licenses)
|
||||||
|
|
||||||
|
self.licheck.validate()
|
Loading…
x
Reference in New Issue
Block a user