diff --git a/.circleci/config.yml b/.circleci/config.yml index 87cd0b5d..6a6bd530 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,7 +51,7 @@ build_singularity: &install_singularity ./mconfig -p /usr/local && \ make -C builddir && \ sudo make -C builddir install - + install_spython: &install_spython name: install spython command: |- @@ -90,7 +90,7 @@ run_linter: &run_linter test_spython: &test_spython name: Test Singularity Python - command: |- + command: |- export PATH=~/conda/Python3/bin:$PATH pytest ~/repo/spython diff --git a/.docs/conf.py b/.docs/conf.py index 53506ab8..96707eb4 100644 --- a/.docs/conf.py +++ b/.docs/conf.py @@ -55,7 +55,7 @@ # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] -from recommonmark.parser import CommonMarkParser +from recommonmark.parser import CommonMarkParser # noqa source_parsers = { ".md": CommonMarkParser, diff --git a/.github/dev-requirements.txt b/.github/dev-requirements.txt new file mode 100644 index 00000000..0b29a889 --- /dev/null +++ b/.github/dev-requirements.txt @@ -0,0 +1,4 @@ +pre-commit +black +isort +flake8 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f18f9ab..e6d154c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,14 +4,13 @@ on: push: branches: - master - pull_request: - branches_ignore: [] + pull_request: [] jobs: formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Check Spelling uses: crate-ci/typos@592b36d23c62cb378f6097a292bc902ee73f93ef # version 1.0.4 @@ -21,18 +20,12 @@ jobs: - name: Setup black linter run: conda create --quiet --name black pyflakes - - name: Lint python code with black + - name: Lint and format Python code run: | export PATH="/usr/share/miniconda/bin:$PATH" source activate black - pip install black - black --check spython - - - name: Check unused imports with pyflakes - run: | - export PATH="/usr/share/miniconda/bin:$PATH" - source activate black - pyflakes spython/oci spython/image.py spython/instance spython/main + pip install -r .github/dev-requirements.txt + pre-commit run --all-files pytest: runs-on: ubuntu-latest @@ -42,21 +35,17 @@ jobs: python-version: [3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 - - uses: eWaterCycle/setup-singularity@bebf1d6f54f9d2d159ac5c15385912dc39b23711 # v7 release - with: - singularity-version: 3.8.4 + - uses: actions/checkout@v3 + - uses: singularityhub/install-singularity@main - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - sudo ln -s $SINGULARITY_ROOT/bin/singularity /usr/bin/ python -m pip install --upgrade pip pip install pytest semver pytest-runner requests - name: Run unit tests - run: | - pytest + run: pytest -xs spython/tests/test*.py diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3e76eee0..be3018cf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,7 +22,7 @@ jobs: pip install setuptools wheel twine - name: Build and publish env: - TWINE_USERNAME: ${{ secrets.PYPI_USER }} + TWINE_USERNAME: ${{ secrets.PYPI_USER }} TWINE_PASSWORD: ${{ secrets.PYPI_PASS }} run: | export PATH="/usr/share/miniconda/bin:$PATH" diff --git a/.github/workflows/update-contributors.yaml b/.github/workflows/update-contributors.yaml index ce42d3a1..15cd0f55 100644 --- a/.github/workflows/update-contributors.yaml +++ b/.github/workflows/update-contributors.yaml @@ -12,11 +12,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Tributors Update + - name: Tributors Update uses: con/tributors@0.0.21 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: + with: parsers: unset update_lookup: github log_level: DEBUG diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..d495c9c7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,30 @@ +exclude: ".all-contributorsrc" +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-docstring-first + - id: mixed-line-ending + + - repo: local + hooks: + - id: black + name: black + language: python + types: [python] + entry: black + + - id: isort + name: isort + args: [--filter-files] + language: python + types: [python] + entry: isort + + - id: flake8 + name: flake8 + language: python + types: [python] + entry: flake8 diff --git a/.tributors b/.tributors index 34abe6bf..9dcb76b4 100644 --- a/.tributors +++ b/.tributors @@ -77,4 +77,4 @@ "name": "Tony Pan", "blog": "https://github.com/tcpan" } -} \ No newline at end of file +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 63219e14..25e36855 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # CHANGELOG -This is a manually generated log to track changes to the repository for each release. -Each section should include general headers such as **Implemented enhancements** -and **Merged pull requests**. All closed issued and bug fixes should be +This is a manually generated log to track changes to the repository for each release. +Each section should include general headers such as **Implemented enhancements** +and **Merged pull requests**. All closed issued and bug fixes should be represented by the pull requests that fixed them. Critical items to know are: @@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to singularity on pypi), and the versions here will coincide with these releases. ## [master](https://github.com/singularityhub/singularity-cli/tree/master) + - dropping support for Singularity 2.x (0.3.0) - add comment out of STOPSIGNAL (0.2.14) - sudo `-E` flag should not be provided by default (0.2.13) - WORKDIR should create container for Singularity converter (0.2.12) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 654af22a..50e81d85 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,8 +25,8 @@ all your interactions with the project members and users. 4. The project's default copyright and header have been included in any new source files. 5. All (major) changes to Singularity Python Client must be documented in - [docs](docs). If your PR changes a core functionality, please - include clear description of the changes in your PR so that the docs + [docs](docs). If your PR changes a core functionality, please + include clear description of the changes in your PR so that the docs can be updated, or better, submit another PR to update the docs directly. 6. If necessary, update the README.md. 7. The pull request will be reviewed by others, and the final merge must be @@ -98,7 +98,7 @@ an incident. Further details of specific enforcement policies may be posted separately. Project maintainers, contributors and users who do not follow or enforce the -Code of Conduct in good faith may face temporary or permanent repercussions +Code of Conduct in good faith may face temporary or permanent repercussions with their involvement in the project as determined by the project's leader(s). ## Attribution diff --git a/README.md b/README.md index 9a9ed6da..4cf3b40d 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ Singularity Python (spython) is the Python API for working with $(function() { $( '#dl-menu' ).dlmenu(); - + $(window).scroll(function () { if ($(window).scrollTop() > 280) { $('#toc').addClass('navbar-fixed'); diff --git a/docs/_includes/page-footer.html b/docs/_includes/page-footer.html index a506063a..22b5718c 100644 --- a/docs/_includes/page-footer.html +++ b/docs/_includes/page-footer.html @@ -1,5 +1,5 @@ @@ -210,7 +210,7 @@ jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); - + - \ No newline at end of file + diff --git a/docs/api/genindex.html b/docs/api/genindex.html index a65fe7be..3420598a 100644 --- a/docs/api/genindex.html +++ b/docs/api/genindex.html @@ -9,17 +9,17 @@ - + - + - +