Skip to content

Latest commit

 

History

History
83 lines (60 loc) · 2.93 KB

File metadata and controls

83 lines (60 loc) · 2.93 KB

Contributing to Translate Java Property Files

Thank you for wanting to help improve this project!

Getting Started

  1. Fork the repository, then clone your fork:

    git clone https://github.com/YourUsername/TranslateJavaProperties.git
    cd TranslateJavaProperties
  2. (Optional) Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
    # or for Windows:
    # python -m venv venv
    # venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt

Pull Request Guidelines

  • All PRs should be made against the main branch.
  • Include a concise description of the changes.
  • Ensure that all tests pass locally (run pytest -v).
  • Maintain a consistent coding style; run black . (or your preferred formatter) before committing if you’ve configured one.

Python Dependency Management

This project uses pip-tools to manage Python dependencies, ensuring reproducible builds.

  • requirements.in: This file contains the primary, top-level dependencies for the application (e.g., openai, pyyaml).
  • requirements-dev.in: This file contains dependencies used only for development and testing (e.g., pytest).
  • requirements.txt and requirements-dev.txt: These are the locked dependency files generated by pip-compile. They contain the exact versions of all top-level and transitive dependencies. Do not edit these files manually.

Updating Dependencies

When you need to add or update a Python dependency, please edit the appropriate .in file:

  • requirements.in for production dependencies.
  • requirements-dev.in for development and testing dependencies.

After editing, follow these steps:

  1. Ensure you have pip-tools installed in your environment (pip install pip-tools).
  2. Navigate to the project's root directory.
  3. Re-compile the locked requirement files by running the following commands from the project root:
    # (Optionally add --generate-hashes for stronger integrity)
    pip-compile requirements.in --generate-hashes
    pip-compile requirements-dev.in --generate-hashes
  4. Commit the changes to both the .in file and the generated .txt file to your pull request.

Installing the locked dependencies locally

Use pip-tools' pip-sync to exactly match the lockfiles:

pip-sync requirements.txt requirements-dev.txt

Code Style

This project uses black for code formatting and ruff for linting. Please ensure your contributions are formatted correctly before submitting a pull request. You can run the formatter and linter from the project root:

black .
ruff . --fix

This will automatically format your code and fix any simple linting issues.

Code of Conduct

Be respectful and constructive in your interactions. We welcome all suggestions!

If you have any questions, feel free to open an issue or reach out to the maintainers.