Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions .github/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pre-commit
black
isort
flake8
29 changes: 9 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-contributors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .tributors
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
"name": "Tony Pan",
"blog": "https://github.com/tcpan"
}
}
}
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Singularity Python (spython) is the Python API for working with <a href="https:/
the [documentation](https://singularityhub.github.io/singularity-cli) for installation and usage, and
the [install instructions](https://singularityhub.github.io/singularity-cli/install) for a quick start.

**This library does not support Singularity 2.x! It won't work and we no longer support it.**

We provide a [Singularity](Singularity) recipe for you to use if more convenient, along with the [full modules docstring](https://singularityhub.github.io/singularity-cli/api/source/spython.main.base.html#module-spython.main.base).

As of version 0.1.0, we only support Singularity > 3.5.2. This is done to encourage using
Expand All @@ -15,7 +17,7 @@ you will need to use version 0.0.85 or earlier.

## 😁️ Contributors 😁️

We use the [all-contributors](https://github.com/all-contributors/all-contributors)
We use the [all-contributors](https://github.com/all-contributors/all-contributors)
tool to generate a contributors graphic below.

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
Expand Down Expand Up @@ -49,7 +51,7 @@ tool to generate a contributors graphic below.

<!-- ALL-CONTRIBUTORS-LIST:END -->



## License

Expand Down
1 change: 0 additions & 1 deletion docs/_data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
- title: "Python API Docstring"
url: "https://singularityhub.github.io/singularity-cli/api/source/spython.main.html"
slug: docstring

2 changes: 1 addition & 1 deletion docs/_includes/editable.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$(document).ready(function() {

{% unless page.not_editable %}
var divs = $("#h1,h2,h3,h4");
var divs = $("#h1,h2,h3,h4");
$.each(divs, function(i,e){

// Edit
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<script>
$(function() {
$( '#dl-menu' ).dlmenu();

$(window).scroll(function () {
if ($(window).scrollTop() > 280) {
$('#toc').addClass('navbar-fixed');
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/page-footer.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<footer class="site-footer">
<span class="site-footer-owner"><a target="_blank"
<span class="site-footer-owner"><a target="_blank"
href="{{ site.url }}">{{ site.title }}</a> is maintained by <a href="{{ site.author.url }}">{{ site.author.name }}</a>.</span>
<span class="site-footer-credits">Contribute on <a target="_blank" href="{{ site.github }}">GitHub</a>.</span>
<span style="float:right">
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<script src="{{ site.baseurl }}/js/toc.js"></script>
<script>
$(document).ready(function() {

var headers = '.main-content h1, .main-content h2, .main-content h3'
$('#table-of-contents').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: headers });
$('#table-of-contents').on('click', 'a', function() {
Expand Down
6 changes: 3 additions & 3 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="en-us">

{% include head.html %}
{% include navigation.html %}

Expand All @@ -9,12 +9,12 @@

<br><br><br>
<section class="main-content">
<a href="{{ site.github }}/tree/master/docs/{{ page.path }}"
<a href="{{ site.github }}/tree/master/docs/{{ page.path }}"
target="_blank"
style="float:right; color:#999">
<i class="fa fa-pencil"></i></a>
<hr><br>

{% if page.toc %}
{% include toc.html %}
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions docs/api/_sources/changelog.md.txt
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/api/assets/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -903,4 +903,4 @@ div.math:hover a.headerlink {
#top-link {
display: none;
}
}
}
2 changes: 1 addition & 1 deletion docs/api/assets/css/badge_only.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading