diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 5931267..d9954d3 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -5,14 +5,26 @@ on: - pull_request jobs: - build: + lint-black: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install psf/black requirements + run: | + apt-get update + apt-get install -y python3 python3-venv + - uses: psf/black@stable + with: + options: "--check --verbose" + version: "~= 23.3" + + lint-pylint: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 - - uses: psf/black@stable - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index dfa0fde..d962053 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,8 +10,7 @@ on: branches: [ devel ] jobs: - build: - + test: runs-on: ubuntu-latest steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..54c8694 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,29 @@ +repos: + - repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black + # It is recommended to specify the latest version of Python + # supported by your project here, or alternatively use + # pre-commit's default_language_version, see + # https://pre-commit.com/#top_level-default_language_version + language_version: python3.10 + types: [python] + - repo: https://github.com/pycqa/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + types: [python] + - repo: local + hooks: + - id: pylint + name: pylint + entry: pylint + language: system + types: [python] + args: + [ + "-rn", # Only display messages + "-sn", # Don't display the score + "--rcfile=.pylintrc", # Link to your config file + ] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 49921e5..5cd371b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,49 @@ # Contributing to podman-compose +## Who can contribute? + +- Users that found a bug +- Users that wants to propose new functionalities or enhancements +- Users that want to help other users to troubleshoot their environments +- Developers that want to fix bugs +- Developers that want to implement new functionalities or enhancements + +## Branches + +Please request your PR to be merged into the `devel` branch. +Changes to the `stable` branch are managed by the repository maintainers. + +## Development environment setup + +Note: Some steps are OPTIONAL but all are RECOMMENDED. + +1. Fork the project repo and clone it +```shell +$ git clone https://github.com/USERNAME/podman-compose.git +$ cd podman-compose +``` +1. (OPTIONAL) Create a python virtual environment. Example using [virtualenv wrapper](https://virtualenvwrapper.readthedocs.io/en/latest/): +```shell +mkvirtualenv podman-compose +``` +2. Install the project runtime and development requirements +```shell +$ pip install '.[devel]' +``` +3. (OPTIONAL) Install `pre-commit` git hook scripts (https://pre-commit.com/#3-install-the-git-hook-scripts) +```shell +$ pre-commit install +``` +4. Create a new branch, develop and add tests when possible +5. Run linting & testing before commiting code. Ensure all the hooks are passing. +```shell +$ pre-commit run --all-files +``` +6. Commit your code to your fork's branch. + - Make sure you include a `Signed-off-by` message in your commits. Read [this guide](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) to learn how to sign your commits + - In the commit message reference the Issue ID that your code fixes and a brief description of the changes. Example: `Fixes #516: allow empty network` +7. Open a PR to `containers/podman-compose:devel` and wait for a maintainer to review your work. + ## Adding new commands To add a command you need to add a function that is decorated diff --git a/README.md b/README.md index a91b41d..5968f33 100644 --- a/README.md +++ b/README.md @@ -122,3 +122,7 @@ run a pytest with following command ```shell python -m pytest pytests ``` + +# Contributing guide + +If you are a user or a developer and want to contribute please check the [CONTRIBUTING](CONTRIBUTING.md) section diff --git a/setup.py b/setup.py index d2bea08..4b3f2d1 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,9 @@ setup( "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Intended Audience :: Developers", "Operating System :: OS Independent", "Development Status :: 3 - Alpha", @@ -35,6 +38,14 @@ setup( "pyyaml", "python-dotenv", ], + extras_require={ + "devel": [ + "flake8", + "black", + "pylint", + "pre-commit", + ] + } # test_suite='tests', # tests_require=[ # 'coverage',