feat: Set up comprehensive Python testing infrastructure with Poetry#37
Open
llbbl wants to merge 2 commits intoluchris429:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#37llbbl wants to merge 2 commits intoluchris429:mainfrom
llbbl wants to merge 2 commits intoluchris429:mainfrom
Conversation
- Migrate from requirements.txt to Poetry package management - Configure pytest with coverage reporting and custom markers - Create testing directory structure with shared fixtures - Add development dependencies for testing, linting, and type checking - Set up Poetry scripts for running tests - Update .gitignore with testing and Poetry artifacts
|
Would be possible to use uv instead of poetry ? |
Author
|
sure if thats what you would preffer. |
Author
|
Ok switched to uv. Do you want me update PR description with relevant commands? |
|
I have no rights about purejaxrl, but i have seen than CleanRL use uv instead of poetry. |
Author
|
@Dante-Berth oh I thought you were a contributor. Will see what Chris says then I guess. We can always revert. I'm hopeful that UV will eventually replace pip, but its not in version 1 yet and poetry more mature, so i'm checking for both and defaulting to poetry. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set up Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the PureJaxRL project, migrating from a simple
requirements.txtto a modern Python development setup using Poetry.Changes Made
Package Management
pyproject.tomlwith full Poetry configurationrequirements.txtmaintainedTesting Infrastructure
unit,integration,slow) for test categorizationProject Structure
Configuration
pytest Configuration (in pyproject.toml)
Coverage Configuration
purejaxrlDevelopment Tools
Shared Fixtures (conftest.py)
temp_dir: Temporary directory for test filesrng_key: JAX random key for reproducible testsmock_config: Mock configuration dictionarysample_observation,sample_action,sample_batch: Test datasetup_jax: JAX configuration for testsmock_env_params: Mock environment parameterswandb_mock: Mocked Weights & Biases for testingHow to Use
Running Tests
Writing Tests
tests/unit/tests/integration/conftest.pyfor common test needsValidation
All infrastructure has been validated with a comprehensive test suite (
test_setup_validation.py) that verifies:Notes
poetry.lock) is intentionally not gitignored to ensure reproducible builds.