From a17e2ff55a9551d4ac9191e12b33535f4a34ec43 Mon Sep 17 00:00:00 2001 From: Yicheng Luo Date: Tue, 17 Oct 2023 14:13:59 +0100 Subject: [PATCH] Add hatch configuration Used for development. CI will fail for using hatch as we are installing projects/baselines/requirements.txt which use mujoco-py and we don't have the build-time dependency --- hatch.toml | 19 +++++++++++++ projects/baselines/pyproject.toml | 47 ------------------------------- pyproject.toml | 2 +- 3 files changed, 20 insertions(+), 48 deletions(-) create mode 100644 hatch.toml diff --git a/hatch.toml b/hatch.toml new file mode 100644 index 0000000..f068108 --- /dev/null +++ b/hatch.toml @@ -0,0 +1,19 @@ +[envs.default] +python = "3.9" +features = ["jax", "tf", "dev"] +pre-install-commands = [ + "pip install -r projects/baselines/requirements.txt", +] +post-install-commands = [ + "pip install -e projects/baselines", +] +[envs.default.scripts] +test = "CUDA_VISIBLE_DEVICES='' JAX_DISABLE_MOST_OPTIMIZATIONS=1 pytest -rf --durations=10 {args:corax}" +lint = [ + "ruff .", + "black --check --diff .", +] +fmt = [ + "ruff --fix .", + "black .", +] diff --git a/projects/baselines/pyproject.toml b/projects/baselines/pyproject.toml index 69d0312..651d1f3 100644 --- a/projects/baselines/pyproject.toml +++ b/projects/baselines/pyproject.toml @@ -7,50 +7,3 @@ name = "baselines" version = "0.1.0" authors = [{ name = "Yicheng Luo", email = "ethanluoyc@gmail.com" }] requires-python = ">=3.9" - -[tool.black] -line-length = 88 -target-version = ['py39', 'py310'] -include = '\.pyi?$' -exclude = ''' -/( - \.eggs - | \.git - | \.github - | \.venv - | docs - | third_party - | scratch -)/ -''' - -[tool.ruff] -line-length = 120 -select = [ - "E", # pycodestyle - "F", # pyflakes - "I", -] -ignore = ["E731"] -exclude = ["third_party", ".venv"] - -[tool.ruff.extend-per-file-ignores] -"__init__.py" = ["F401"] - -[tool.ruff.isort] -known-first-party = ["corax", "baselines"] -force-single-line = true -single-line-exclusions = ["typing"] - -[tool.ruff.flake8-tidy-imports] -ban-relative-imports = "all" - -[tool.pyright] -include = ["baselines"] -exclude = ["**/node_modules", "**/__pycache__"] - -reportMissingImports = true -reportMissingTypeStubs = false - -pythonVersion = "3.9" -pythonPlatform = "Linux" diff --git a/pyproject.toml b/pyproject.toml index 30e00eb..670ee20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,7 +92,7 @@ exclude = ["third_party", ".venv"] "__init__.py" = ["F401"] [tool.ruff.isort] -known-first-party = ["corax"] +known-first-party = ["corax", "baselines"] force-single-line = true single-line-exclusions = ["typing"]