diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..577e92c6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM python:3.11 AS base +ENV VIRTUAL_ENV=/opt/venv +ENV PATH="$VIRTUAL_ENV/bin:$PATH" +ENV PYTHONPATH=. +RUN mkdir /app +WORKDIR /app + +RUN python3 -m venv $VIRTUAL_ENV + +RUN apt-get update && \ + apt-get install -y \ + --no-install-recommends \ + make python3-dev + +RUN pip install poetry +COPY README.md pyproject.toml poetry.lock ./ +RUN poetry run pip install setuptools wheel packaging +RUN poetry install --no-root --compile --no-dev + +COPY auto_dev auto_dev +RUN poetry install --compile --no-dev + +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + + +RUN echo $VIRTUAL_ENV +RUN poetry env info +ENTRYPOINT ["poetry", "run"] +ENV PYTHONUNBUFFERED=TRUE + +CMD ["--help"] + diff --git a/Dockerfile.wip b/Dockerfile.wip new file mode 100644 index 00000000..756273cb --- /dev/null +++ b/Dockerfile.wip @@ -0,0 +1,47 @@ +FROM pypy:3.10 AS base +ENV VIRTUAL_ENV=/opt/venv +ENV PATH="$VIRTUAL_ENV/bin:$PATH" +ENV PYTHONPATH=. +ENV PYTHONUNBUFFERED=TRUE +ENV PATH="/root/.cargo/bin:$PATH" + +RUN mkdir /app +WORKDIR /app + +RUN python3 -m venv $VIRTUAL_ENV + +RUN apt-get update && \ + apt-get install -y \ + --no-install-recommends \ + make python3-dev + +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y + +RUN pip install poetry +COPY README.md pyproject.toml poetry.lock ./ +RUN poetry run pip install -U setuptools wheel packaging pip + + +# We need to make sure we have all the necessary deps to build cffi +RUN apt-get install build-essential curl gcc libffi-dev libssl-dev -y + +# Get Rust + +RUN rustc --version +RUN cargo install --locked maturin + +RUN poetry run pip install -U setuptools yarl +RUN poetry install --only-main + +COPY auto_dev auto_dev +RUN poetry install + +RUN poetry run python -m pip install maturin + + + + +ENTRYPOINT ["poetry", "run"] + +CMD ["--help"] + diff --git a/auto_dev/fmt.py b/auto_dev/fmt.py index ec309352..75c1570e 100644 --- a/auto_dev/fmt.py +++ b/auto_dev/fmt.py @@ -2,6 +2,8 @@ from multiprocessing import Pool +import isort +import isort.files import requests from rich.progress import track @@ -63,6 +65,10 @@ def run_format(path, verbose=False): @staticmethod def run_sort(path, verbose=False): """Run sort on the path.""" + + @staticmethod + def run_autoflake8(path, verbose=False): + """Run autoflake8 on the path.""" command = CommandExecutor( [ "poetry", @@ -79,7 +85,6 @@ def run_sort(path, verbose=False): ) return command.execute(verbose=verbose) - def single_thread_fmt(paths, verbose, logger, remote=False): """Run the formatting in a single thread.""" results = {} @@ -96,7 +101,6 @@ def single_thread_fmt(paths, verbose, logger, remote=False): results[package] = result return results - def multi_thread_fmt(paths, verbose, num_processes, remote=False): """Run the formatting in multiple threads.""" formatter = Formatter(verbose, remote=remote) diff --git a/pyproject.toml b/pyproject.toml index e3c7ab88..7836530c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,10 +24,6 @@ classifiers = [ [[tool.poetry.packages]] include = "auto_dev" -[[tool.poetry.packages]] -include = "tests" -format = "sdist" - [tool.black] line-length = 120 skip-string-normalization = true @@ -46,6 +42,7 @@ open-aea-ledger-cosmos = "==1.60.0" open-aea-cli-ipfs = "==1.60.0" web3 = ">=6.0.0,<7.0.0" ipfshttpclient = "==0.8.0a2" +web3 = "<7,>=6.0.0" typing_extensions = ">=3.10.0.2" protobuf = ">=3.19.1,<4.25.0" hypothesis = "==6.122.3"