-
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.
Merge pull request #9 from P6-Pool/pyproject
Restructure, cleanup and linting
- Loading branch information
Showing
40 changed files
with
851 additions
and
936 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,39 @@ | ||
name: Python package | ||
on: | ||
push: | ||
pull_request: | ||
branches: ['main'] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.10', '3.11'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install python3-opengl swig libgsl-dev | ||
python -m pip install --upgrade pip | ||
pip install ".[test]" | ||
- name: Lint with Ruff | ||
run: | | ||
ruff check src/fastfiz_env | ||
ruff format src/fastfiz_env | ||
- name: Run MyPy | ||
run: | | ||
mypy src/fastfiz_env | ||
- name: Test with pytest | ||
run: | | ||
pytest |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,57 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
|
||
[project] | ||
name = "fastfiz-env" | ||
description = "Gymnasium environments for FastFiz pool simulator." | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
dynamic = ["version"] | ||
dependencies = [ | ||
"fastfiz @ git+https://github.com/P6-Pool/fastfiz.git", | ||
"gymnasium", | ||
"numpy", | ||
"vectormath", | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"fastfiz_renderer @ git+https://github.com/P6-Pool/fastfiz-renderer.git", | ||
"stable-baselines3", | ||
"tqdm", | ||
"rich", | ||
"torch", | ||
"tensorboard", | ||
"optuna", | ||
] | ||
test = ["pytest", "mypy", "ruff"] | ||
all = [ | ||
# dev | ||
"fastfiz_renderer @ git+https://github.com/P6-Pool/fastfiz-renderer.git", | ||
"stable-baselines3", | ||
"tqdm", | ||
"rich", | ||
"torch", | ||
"tensorboard", | ||
"optuna", | ||
# test | ||
"pytest", | ||
"mypy", | ||
"ruff", | ||
] | ||
|
||
[tool.pytest.ini_options] | ||
filterwarnings = [ | ||
"ignore::DeprecationWarning:tensorboard", | ||
"ignore::UserWarning:gym", | ||
] | ||
|
||
[tool.mypy] | ||
ignore_missing_imports = true | ||
follow_imports = "silent" | ||
show_error_codes = true | ||
|
||
[tool.ruff] | ||
line-length = 127 |
This file was deleted.
Oops, something went wrong.
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,15 +1,23 @@ | ||
from setuptools import setup, find_packages | ||
import re | ||
from setuptools import setup | ||
|
||
# with open("requirements.txt") as f: | ||
# requirements = f.read().splitlines() | ||
|
||
|
||
def get_version(): | ||
with open("src/fastfiz_env/__init__.py", "r") as f: | ||
for line in f: | ||
match = re.match(r"__version__\s*=\s*['\"]([^'\"]+)['\"]", line) | ||
if match: | ||
return match.group(1) | ||
raise RuntimeError("Version not found in __init__.py") | ||
|
||
with open("requirements.txt") as f: | ||
requirements = f.read().splitlines() | ||
|
||
setup( | ||
name="fastfiz-env", | ||
description="Gymnasium environment for FastFiz pool simulator", | ||
version="0.0.1", | ||
license="MIT", | ||
install_requires=requirements, | ||
test_requires=["pytest"], | ||
packages=find_packages(where="src"), | ||
package_dir={"": "src"}, | ||
version=get_version(), | ||
# install_requires=requirements, | ||
# test_requires=["pytest"], | ||
# packages=find_packages(where="src"), | ||
# package_dir={"": "src"}, | ||
) |
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
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
Oops, something went wrong.