diff --git a/.github/workflows/check-examples.yml b/.github/workflows/check-examples.yml index 8fed8a813..4f557228b 100644 --- a/.github/workflows/check-examples.yml +++ b/.github/workflows/check-examples.yml @@ -19,22 +19,20 @@ jobs: - name: Checkout repository code uses: actions/checkout@v4 - # Setup Python (faster than using Python container) + # Setup Python with caching - name: Setup Python uses: actions/setup-python@v5 with: python-version: 3.11 + cache: 'pip' - name: Install Python Kernel run: | pip install ipykernel python -m ipykernel install --user --name python3 - - name: Install dev dependencies - run: pip install -r requirements-dev.txt - - name: Install dependencies - run: pip install -r requirements.txt + run: pip install .[dev] - name: Build package run: | @@ -101,4 +99,4 @@ jobs: exit 1 fi rm examples/temp.ipynb - done \ No newline at end of file + done diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d0010d81a..70d5bba66 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,11 +25,8 @@ jobs: with: python-version: "3.10" - - name: Install dev dependencies - run: pip install -r requirements-dev.txt - - name: Install dependencies - run: pip install -r requirements.txt + run: pip install .[dev] - name: Download Pandoc run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 04ad7214b..846dd2ee5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,17 +23,15 @@ jobs: - name: Checkout repository code uses: actions/checkout@v4 - # Setup Python (faster than using Python container) + # Setup Python with caching - name: Setup Python uses: actions/setup-python@v5 with: python-version: ${{ matrix.version }} - - - name: Install dev dependencies - run: pip install -r requirements-dev.txt + cache: 'pip' - name: Install dependencies - run: pip install -r requirements.txt + run: pip install .[dev] - name: Run tests run: PYTHONPATH=src pytest -x --cov=src/poke_env unit_tests/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 253de7804..33f133635 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,7 @@ First, you should use a python virtual environment. Which flavor of virtual envi This project supports multiple versions of python 3, starting from version 3.9. You can use any supported version for development, but bear in mind that your work will be tested on all supported versions. -Once you have created your virtual environment, install dependencies with `pip install -r requirements.txt` and `pip install -r requirements-dev.txt`. You can now setup pre-commits by running `pre-commit install` - the pre-commit configuration on the repo by defaults assumes Python 3.10.5, but you can modify it locally to your liking. +Once you have created your virtual environment, install dependencies with `pip install .` and `pip install .[dev]`. You can now setup pre-commits by running `pre-commit install` - the pre-commit configuration on the repo by defaults assumes Python 3.10.5, but you can modify it locally to your liking. ## Locally testing your commits diff --git a/README.md b/README.md index 07ee14403..365a30ee9 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,7 @@ git clone https://github.com/hsahovic/poke-env.git Dependencies and development dependencies can then be installed with: ``` -pip install -r requirements.txt -pip install -r requirements-dev.txt +pip install .[dev] ``` ## Acknowledgements diff --git a/pyproject.toml b/pyproject.toml index 3c4e6d563..ec63677a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,34 @@ classifiers = [ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["dependencies"] +dependencies = [ + "gymnasium>=1.0.0", + "numpy>=2.0.2", + "orjson>=3.10.15", + "pettingzoo>=1.24.3", + "requests>=2.32.3", + "tabulate>=0.9.0", + "websockets==14.2", +] + +[project.optional-dependencies] +dev = [ + "black==25.1.0", + "flake8>=7.1.1", + "isort==6.0.0", + "mypy>=1.15.0", + "nbsphinx>=0.9.6", + "pre-commit>=4.1.0", + "pytest>=8.3.4", + "pytest-asyncio>=0.25.3", + "pytest-cov>=6.0.0", + "pytest-timeout>=2.3.1", + "sphinx>=7.4.7", + "sphinx-rtd-theme>=3.0.2", + "twine>=6.1.0", + "types-requests>=2.32.0.20241016", + "wheel>=0.45.1", +] [project.urls] Documentation = "https://poke-env.readthedocs.io/en/stable/" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 11b8d8558..000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,15 +0,0 @@ -black==25.1.0 -flake8 -isort==6.0.0 -mypy -nbsphinx -pre-commit -pytest -pytest-asyncio -pytest-cov -pytest-timeout -sphinx -sphinx_rtd_theme -twine -types-requests -wheel diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 39ac62061..000000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -gymnasium -numpy -orjson -pettingzoo -requests -tabulate -websockets==14.2