From 36522526558dc65fe7db11ebc8ffa57e02dddca7 Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Wed, 7 Dec 2022 19:53:36 -0700 Subject: [PATCH 01/18] Debugging build failures in actions --- .github/workflows/main.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f18f9a..23a4dea 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 @@ -42,12 +41,12 @@ jobs: python-version: [3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: eWaterCycle/setup-singularity@bebf1d6f54f9d2d159ac5c15385912dc39b23711 # v7 release with: singularity-version: 3.8.4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -58,5 +57,4 @@ jobs: pip install pytest semver pytest-runner requests - name: Run unit tests - run: | - pytest + run: pytest From 6969d2f9d293ebf5fcc58ec20af8a6f43850a4f2 Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Wed, 7 Dec 2022 19:59:43 -0700 Subject: [PATCH 02/18] Try ubuntu 20.04 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 23a4dea..153bfde 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ on: jobs: formatting: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 From 252ce57645e6a0b0a2d1bf426223fbb06b968b3c Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Wed, 7 Dec 2022 20:04:29 -0700 Subject: [PATCH 03/18] Try default older version --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 153bfde..7ea44aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ on: jobs: formatting: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@v3 - uses: eWaterCycle/setup-singularity@bebf1d6f54f9d2d159ac5c15385912dc39b23711 # v7 release with: - singularity-version: 3.8.4 + singularity-version: 3.6.1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From c471516e5ff7c472f158e5f1156dcba5f0bcb6b9 Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Wed, 7 Dec 2022 20:06:37 -0700 Subject: [PATCH 04/18] Try using default version singularity --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7ea44aa..432c72e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,8 +43,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: eWaterCycle/setup-singularity@bebf1d6f54f9d2d159ac5c15385912dc39b23711 # v7 release - with: - singularity-version: 3.6.1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From 320d5131f4a911fca3deaf4477bd3449cb65febe Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Wed, 7 Dec 2022 20:07:53 -0700 Subject: [PATCH 05/18] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 432c72e..9e28361 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: eWaterCycle/setup-singularity@bebf1d6f54f9d2d159ac5c15385912dc39b23711 # v7 release + with: + singularity_version: 3.7.1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From e62c10bf25a210d698f6ffc283936005ba9a789d Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Wed, 7 Dec 2022 20:08:58 -0700 Subject: [PATCH 06/18] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e28361..10cef40 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@v3 - uses: eWaterCycle/setup-singularity@bebf1d6f54f9d2d159ac5c15385912dc39b23711 # v7 release with: - singularity_version: 3.7.1 + singularity-version: 3.7.1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From c57a0d4f0260696933f282b3b07e6e87025f1d76 Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Wed, 7 Dec 2022 20:34:44 -0700 Subject: [PATCH 07/18] debug from our own action --- .github/workflows/main.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10cef40..8f29b92 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,9 +42,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: eWaterCycle/setup-singularity@bebf1d6f54f9d2d159ac5c15385912dc39b23711 # v7 release - with: - singularity-version: 3.7.1 + - uses: singularityhub/install-singularity@main - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -52,7 +50,6 @@ jobs: - 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 From 487aac37ecddfb6feaf387b194f807c77119a56d Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Wed, 7 Dec 2022 20:36:53 -0700 Subject: [PATCH 08/18] use develop --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f29b92..f200bfa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: singularityhub/install-singularity@main + - uses: singularityhub/install-singularity@develop - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From d3ed69608c8755b866d3bc0a189e55a82d69c9da Mon Sep 17 00:00:00 2001 From: vsoch Date: Wed, 7 Dec 2022 21:34:21 -0700 Subject: [PATCH 09/18] updating tests and removing unnedded dep Signed-off-by: vsoch --- .circleci/config.yml | 4 +- .docs/conf.py | 2 +- .github/dev-requirements.txt | 4 + .github/workflows/main.yml | 18 +- .github/workflows/release.yaml | 2 +- .github/workflows/update-contributors.yaml | 4 +- .pre-commit-config.yaml | 32 + .tributors | 2 +- CHANGELOG.md | 7 +- CONTRIBUTING.md | 6 +- README.md | 6 +- docs/_data/toc.yml | 1 - docs/_includes/editable.html | 2 +- docs/_includes/navigation.html | 2 +- docs/_includes/page-footer.html | 2 +- docs/_includes/toc.html | 2 +- docs/_layouts/default.html | 6 +- docs/api/_sources/changelog.md.txt | 6 +- docs/api/assets/basic.css | 2 +- docs/api/assets/css/badge_only.css | 2 +- .../assets/css/fonts/fontawesome-webfont.svg | 1418 ++++++++--------- docs/api/assets/css/theme.css | 2 +- docs/api/assets/documentation_options.js | 2 +- docs/api/assets/js/badge_only.js | 2 +- docs/api/assets/js/html5shiv-printshiv.min.js | 2 +- docs/api/assets/js/html5shiv.min.js | 2 +- docs/api/assets/js/theme.js | 2 +- docs/api/assets/language_data.js | 2 - docs/api/assets/pygments.css | 2 +- docs/api/assets/underscore.js | 2 +- docs/api/changelog.html | 14 +- docs/api/genindex.html | 16 +- docs/api/index.html | 14 +- docs/api/modules/index.html | 14 +- docs/api/modules/spython/client.html | 14 +- docs/api/modules/spython/client/recipe.html | 14 +- docs/api/modules/spython/client/shell.html | 14 +- docs/api/modules/spython/client/test.html | 14 +- docs/api/modules/spython/image.html | 14 +- docs/api/modules/spython/instance.html | 14 +- docs/api/modules/spython/instance/cmd.html | 14 +- .../modules/spython/instance/cmd/start.html | 14 +- .../modules/spython/instance/cmd/stop.html | 14 +- docs/api/modules/spython/logger/message.html | 14 +- docs/api/modules/spython/logger/progress.html | 14 +- docs/api/modules/spython/logger/spinner.html | 14 +- docs/api/modules/spython/main.html | 14 +- docs/api/modules/spython/main/apps.html | 14 +- docs/api/modules/spython/main/base.html | 14 +- .../modules/spython/main/base/command.html | 14 +- docs/api/modules/spython/main/base/flags.html | 14 +- .../modules/spython/main/base/generate.html | 14 +- .../api/modules/spython/main/base/logger.html | 14 +- .../api/modules/spython/main/base/sutils.html | 14 +- docs/api/modules/spython/main/build.html | 14 +- docs/api/modules/spython/main/execute.html | 14 +- docs/api/modules/spython/main/help.html | 14 +- docs/api/modules/spython/main/inspect.html | 14 +- docs/api/modules/spython/main/instances.html | 14 +- .../modules/spython/main/parse/recipe.html | 14 +- docs/api/modules/spython/main/pull.html | 14 +- docs/api/modules/spython/main/run.html | 14 +- docs/api/modules/spython/utils/fileio.html | 14 +- docs/api/modules/spython/utils/terminal.html | 14 +- docs/api/py-modindex.html | 14 +- docs/api/search.html | 22 +- docs/api/searchindex.js | 2 +- docs/api/source/modules.html | 14 +- docs/api/source/spython.client.html | 14 +- docs/api/source/spython.html | 14 +- docs/api/source/spython.image.cmd.html | 14 +- docs/api/source/spython.image.html | 14 +- docs/api/source/spython.instance.cmd.html | 14 +- docs/api/source/spython.instance.html | 14 +- docs/api/source/spython.logger.html | 14 +- docs/api/source/spython.main.base.html | 14 +- docs/api/source/spython.main.html | 14 +- docs/api/source/spython.main.parse.html | 14 +- docs/api/source/spython.tests.html | 14 +- docs/api/source/spython.utils.html | 14 +- docs/css/sregistry.css | 30 +- docs/js/jquery.dlmenu.js | 26 +- docs/js/lunr.min.js | 2 +- docs/js/modernizr.custom.js | 2 +- docs/js/search.js | 2 +- docs/pages/commands-images.md | 88 +- docs/pages/commands-instances.md | 10 +- docs/pages/commands-oci.md | 28 +- docs/pages/commands.md | 2 +- docs/pages/recipes.md | 24 +- pyproject.toml | 7 + requirements.txt | 2 - setup.cfg | 9 + setup.py | 3 +- spython/client/__init__.py | 2 +- spython/client/shell.py | 2 +- spython/main/__init__.py | 4 +- spython/main/base/Dockerfile | 2 +- spython/main/base/README.md | 4 +- spython/main/base/__init__.py | 21 +- spython/main/base/flags.py | 36 +- spython/main/execute.py | 7 +- spython/main/inspect.py | 2 +- spython/main/parse/parsers/README.md | 2 +- spython/main/parse/parsers/docker.py | 4 +- spython/main/parse/parsers/singularity.py | 2 +- spython/main/run.py | 2 +- spython/oci/config.json | 216 ++- spython/tests/test_client.sh | 2 +- spython/tests/test_oci.py | 20 +- spython/tests/test_utils.py | 30 +- .../docker2singularity/multistage.def | 4 +- .../singularity2docker/multistage.def | 2 +- spython/utils/__init__.py | 2 - spython/utils/terminal.py | 35 +- spython/version.py | 5 +- 116 files changed, 1505 insertions(+), 1382 deletions(-) create mode 100644 .github/dev-requirements.txt create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject.toml delete mode 100644 requirements.txt create mode 100644 setup.cfg diff --git a/.circleci/config.yml b/.circleci/config.yml index 87cd0b5..6a6bd53 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 53506ab..96707eb 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 0000000..0b29a88 --- /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 f200bfa..0508b32 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,18 +20,12 @@ jobs: - name: Setup black linter run: conda create --quiet --name black pyflakes - - name: Lint python code with black - 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 + - name: Lint and format Python code + run: | + export PATH="/usr/share/miniconda/bin:$PATH" + source activate black + pip install -r .github/dev-requirements.txt + pre-commit run --all-files pytest: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3e76eee..be3018c 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 ce42d3a..15cd0f5 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 0000000..21c0b59 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,32 @@ +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: end-of-file-fixer + - id: trailing-whitespace + - 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 34abe6b..9dcb76b 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 63219e1..25e3685 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 654af22..50e81d8 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 9a9ed6d..b91bb52 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 a506063..22b5718 100644 --- a/docs/_includes/page-footer.html +++ b/docs/_includes/page-footer.html @@ -1,5 +1,5 @@
- {{ site.title }} is maintained by {{ site.author.name }}. Contribute on GitHub. diff --git a/docs/_includes/toc.html b/docs/_includes/toc.html index fab809d..212196a 100644 --- a/docs/_includes/toc.html +++ b/docs/_includes/toc.html @@ -2,7 +2,7 @@ @@ -17,10 +17,10 @@ - + - +
@@ -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 a65fe7b..3420598 100644 --- a/docs/api/genindex.html +++ b/docs/api/genindex.html @@ -9,17 +9,17 @@ - + - + - +