diff --git a/.github/workflows/common_check.yaml b/.github/workflows/common_check.yaml index d605da0..851cf92 100644 --- a/.github/workflows/common_check.yaml +++ b/.github/workflows/common_check.yaml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10",] + python-version: ["3.8", "3.9", "3.10", "3.11"] poetry-version: ["1.3.2"] os: [ubuntu-20.04,] runs-on: ${{ matrix.os }} @@ -32,20 +32,27 @@ jobs: with: version: ${{ matrix.poetry-version }} virtualenvs-create: true + virtualenvs-in-project: false + virtualenvs-path: ~/my-custom-path installer-parallel: true - - name: Install Adev + - name: Install Packages run: | - bash auto_dev/data/repo/templates/autonomy/install.sh + poetry install -v - - name: Format + - name: Install Host Dependencies run: | - poetry run adev -n 0 -v fmt -p . + poetry run python script/install.py - name: Lint run: | - poetry run adev -n 0 -v lint -p . + poetry run adev lint -p tests + poetry run adev lint -p rysk_client - name: Tests run: | poetry run adev -v test -p . + + - name: Doc Tests + run: | + make test-docs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8b64e2..c082aac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,14 +34,6 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 -# - name: Get Changelog Entry -# id: changelog_reader -# uses: mindsers/changelog-reader-action@v2 -# with: -# validation_depth: 10 -# version: ${{ steps.tag_name.outputs.current_version }} -# path: ./CHANGELOG.md - - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-versions }} @@ -51,24 +43,10 @@ jobs: python -m pip install --upgrade pip pip install poetry - - name: build documentation - run: | - poetry install -E doc - poetry run mkdocs build - -# - name: publish documentation -# uses: peaceiris/actions-gh-pages@v3 -# with: -# personal_token: ${{ secrets.PERSONAL_TOKEN }} -# publish_dir: ./site - - name: Build wheels and source tarball run: >- poetry build - - name: show temporary files - run: >- - ls -l - name: create github release id: create_release diff --git a/Makefile b/Makefile index 1df86df..de509a3 100644 --- a/Makefile +++ b/Makefile @@ -9,4 +9,7 @@ fmt: lint: poetry run flake8 tests lyra -all: fmt lint tests \ No newline at end of file +all: fmt lint tests + +test-docs: + echo making docs diff --git a/install.py b/install.py new file mode 100644 index 0000000..7032aba --- /dev/null +++ b/install.py @@ -0,0 +1,64 @@ +""" +Installations for the necessary packages. +""" + +import os +from dataclasses import dataclass + +from rich.progress import track + +from rysk_client.src.utils import get_logger + +logger = get_logger() + + +@dataclass +class HostDependency: + """ + represents a host dependency + """ + + name: str + install_cmd: str + + def is_present(self) -> bool: + """ + silently check if the dependency is present on the host + """ + return os.popen(f"which {self.name}").read() != "" + + def install(self) -> None: + """ + install the dependency + """ + os.system(self.install_cmd) + + +def install_dependencies() -> None: + """ + install the dependencies + """ + dependencies = [ + ( + "rustc", + "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh", + ), + ( + "anvil", + "git clone https://github.com/foundry-rs/foundry && " + + "cd foundry && " + + "cargo install --path ./anvil --bins --locked --force && " + + "rm -rf ../foundry", + ), + ] + logger.info(f"Installing {len(dependencies)} dependencies") + for dependency in track(dependencies): + dep = HostDependency(*dependency) + if not dep.is_present(): + logger.info(f"Installing {dep.name}") + # dep.install() + logger.info("Done!") + + +if __name__ == "__main__": + install_dependencies()