Skip to content

Commit

Permalink
Merge branch 'master' into create_from_lxd
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-engelmann authored Apr 23, 2021
2 parents bb6eacb + 82a6adb commit 8d84ffd
Show file tree
Hide file tree
Showing 105 changed files with 6,747 additions and 5,830 deletions.
11 changes: 0 additions & 11 deletions .coveragerc

This file was deleted.

18 changes: 18 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file contains all the revisions that are only formatting changes and
# should usually be ignored when running 'git blame'.
#
# Make use of it on a single file by running:
#
# git blame --ignore-revs-file .git-blame-ignore-revs FILE
#
# ... or for global setting (most useful) configure git:
#
# git config blame.ignoreRevsFile .git-blame-ignore-revs
#
# Note that git 2.23 or newer is required for this to work

# Blacken all the code
f76cf13e23603717caec8af611e1a1889bca9eb4

# Blacken and isort contrib_testing, integration and migration code
dcaa938e29ff1d31c5e2fc264d10b8a699dccf4e
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
lint-python:
runs-on: ubuntu-latest
steps:
- name: Repository checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.6"

- name: Install dependencies
run: |
pip install --upgrade pip tox
- name: Lint Python files
run: |
tox -e lint
lint-shell:
runs-on: ubuntu-latest
steps:
- name: Repository checkout
uses: actions/checkout@v2

- name: Lint shell files
uses: ludeeus/action-shellcheck@master

check:
runs-on: ubuntu-latest
steps:
- name: Repository checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.6"

- name: Install dependencies
run: |
pip install --upgrade pip tox
- name: Typecheck Python files
run: |
tox -e check
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
steps:
- name: Repository checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install --upgrade pip tox codecov
- name: Test
run: |
tox -e coverage
codecov
43 changes: 2 additions & 41 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,59 +1,20 @@
*.py[cod]

# C extensions
*.so

# Packages
*.egg
.eggs
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64

# Installer logs
pip-log.txt
dist/

# Unit test / coverage reports
.coverage
.tox
nosetests.xml
.testrepository
.venv
htmlcov/

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Pycharm
.idea/

# Complexity
output/*.html
output/*/index.html

# Sphinx
doc/build

# pbr generates these
AUTHORS
ChangeLog

# Editors
*~
.*.swp
.*sw?
.idea/
*.sublime-*
4 changes: 0 additions & 4 deletions .gitreview

This file was deleted.

3 changes: 0 additions & 3 deletions .mailmap

This file was deleted.

25 changes: 25 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Use the latest image - see https://github.com/readthedocs/readthedocs-docker-images
build:
image: latest

sphinx:
configuration: doc/source/conf.py

formats:
- pdf
- epub

python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- docs
7 changes: 0 additions & 7 deletions .testr.conf

This file was deleted.

21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@ These are the contributors to pylxd according to the Github repository.
mrtc0 Kohei Morita
gabrik Gabriele Baldoni
felix-engelmann Felix Engelmann
weichweich ???
anneborcherding Anne Borcherding
=============== ==================================

10 changes: 3 additions & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
include AUTHORS
include ChangeLog
exclude .gitignore
exclude .gitreview
exclude contrib_testing

global-exclude *.pyc
include CONTRIBUTORS.rst
include README.rst
include LICENSE
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ pylxd

.. image:: http://img.shields.io/pypi/v/pylxd.svg
:target: https://pypi.python.org/pypi/pylxd
.. image:: https://travis-ci.org/lxc/pylxd.svg?branch=master
:target: https://travis-ci.org/lxc/pylxd
.. image:: https://github.com/lxc/pylxd/workflows/CI%20tests/badge.svg
:target: https://github.com/lxc/pylxd/actions?query=workflow%3A%22CI+tests%22
.. image:: https://codecov.io/github/lxc/pylxd/coverage.svg?branch=master
:target: https://codecov.io/github/lxc/pylxd
.. image:: https://readthedocs.org/projects/docs/badge/?version=latest
.. image:: https://readthedocs.org/projects/pylxd/badge/?version=latest
:target: https://pylxd.readthedocs.io/en/latest/?badge=latest

A Python library for interacting with the LXD REST API.
Expand Down
1 change: 0 additions & 1 deletion babel.cfg

This file was deleted.

1 change: 0 additions & 1 deletion blacklist

This file was deleted.

35 changes: 19 additions & 16 deletions contrib_testing/local-http-test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python3

import datetime
import pylxd
import requests
import time

import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning

import pylxd

requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

Expand All @@ -18,22 +18,25 @@ def log(s):

def create_and_update(client):
log("Creating...")
base = client.containers.create({
'name': 'ubuntu-1604',
'source': {
'type': 'image',
'protocol': 'simplestreams',
'server': 'https://images.linuxcontainers.org',
'alias': 'ubuntu/xenial/amd64'
}
}, wait=True)
base = client.containers.create(
{
"name": "ubuntu-1604",
"source": {
"type": "image",
"protocol": "simplestreams",
"server": "https://images.linuxcontainers.org",
"alias": "ubuntu/xenial/amd64",
},
},
wait=True,
)
log("starting...")
base.start(wait=True)
while len(base.state().network['eth0']['addresses']) < 2:
while len(base.state().network["eth0"]["addresses"]) < 2:
time.sleep(1)
commands = [
['apt-get', 'update'],
['apt-get', 'install', 'openssh-server', 'sudo', 'man', '-y']
["apt-get", "update"],
["apt-get", "install", "openssh-server", "sudo", "man", "-y"],
]
for command in commands:
log("command: {}".format(command))
Expand All @@ -43,9 +46,9 @@ def create_and_update(client):
log("stderr: {}".format(result.stderr))


if __name__ == '__main__':
if __name__ == "__main__":
client = pylxd.Client("https://127.0.0.1:8443/", verify=False)
log("Authenticating...")
client.authenticate('password')
client.authenticate("password")

create_and_update(client)
Loading

0 comments on commit 8d84ffd

Please sign in to comment.