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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ jobs:
# Unpack tarball and verify + run the tests
tar -xzvf "${TARBALL_FILENAME}"

cd "apache_libcloud-${VERSION}/"
cd "apache_libcloud-${VERSION}/"
tox -c tox.ini -epy3.10

- name: Verify Wheel Release Artifact
Expand Down
98 changes: 98 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
exclude: |
(?x)^(
docs/(?:.*/)?_supported_.*\.rst$|
libcloud/data/pricing\.json$
)

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: check-json
exclude: |
(?x)^(
libcloud/test/dns/fixtures/pointdns/not_found\.json|
libcloud/test/dns/fixtures/godaddy/v1_domains_purchase_schema_com\.json|
libcloud/test/dns/fixtures/gandi_live/get_bad_zone\.json
)$
- id: end-of-file-fixer
files: &text_files |
(?x)^(
libcloud/|
docs/|
demos/|
integration/|
scripts/|
contrib/|
pylint_plugins/|
\.github/|
[^/]+\.(py|rst|md|yml|yaml|toml|json|xml|txt|csv|ini|cfg|sh)$
)
exclude: &fixture_exclude |
(?x)^(
libcloud/test/.*/fixtures/|
integration/.*/fixtures/
)
- id: trailing-whitespace
files: *text_files
exclude: *fixture_exclude

- repo: https://github.com/psf/black
rev: "25.1.0"
hooks:
- id: black
args: ["--config=pyproject.toml"]
files: &fmt_py_files |
(?x)^(
libcloud/|
docs/examples/|
docs/|
demos/|
contrib/|
pylint_plugins/|
integration/|
[^/]+\.py$
)

- repo: https://github.com/pycqa/isort
rev: "6.0.1"
hooks:
- id: isort
args: ["--settings-path=pyproject.toml"]
files: *fmt_py_files

- repo: https://github.com/pycqa/flake8
rev: "5.0.4"
hooks:
- id: flake8
args: ["--config=./.flake8"]
files: &lint_py_files |
(?x)^(
libcloud/|
libcloud/test/|
demos/|
integration/|
scripts/|
docs/examples/|
contrib/|
pylint_plugins/
)

- repo: https://github.com/asottile/pyupgrade
rev: "v3.3.1"
hooks:
- id: pyupgrade
args: ["--py310-plus", "--py3-only"]
files: *lint_py_files

- repo: https://github.com/codespell-project/codespell
rev: "v2.4.1"
hooks:
- id: codespell
additional_dependencies: ["tomli"]
args: ["--toml", "pyproject.toml"]
files: ^libcloud/
6 changes: 3 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,8 @@ Compute
(#1615)
[Miguel Caballer - @micafer]

- [CloudSigma] Various updates, improvements and new functionality in the
driver (support for new regions, instance types, additional standard API an
- [CloudSigma] Various updates, improvements and new functionality in the
driver (support for new regions, instance types, additional standard API an
extension methods, etc.).

(#1558)
Expand Down Expand Up @@ -1060,7 +1060,7 @@ Compute
(#1492)
[Miguel Caballer - @micafer]

- [EC2] Update supported EC2 regions and instance sizes and add support
- [EC2] Update supported EC2 regions and instance sizes and add support
for eu-north-1 region.
(#1486)
[Arturo Noha - @r2ronoha]
Expand Down
32 changes: 0 additions & 32 deletions contrib/pre-commit.sh

This file was deleted.

2 changes: 1 addition & 1 deletion docs/_static/images/provider_logos/scaleway.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/backup/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Backup Base API
:members:

.. autoclass:: libcloud.backup.types.BackupTargetJobStatusType
:members:
:members:
8 changes: 4 additions & 4 deletions docs/compute/drivers/cloudscale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Most of the `cloudscale.ch` API is covered by the simple commands:
- ``driver.destroy_node(node)``
- ``driver.create_node(name, size, image, ex_create_attr={})``

In our :ref:`example <cloudscale-examples>` below you can see how you use
``ex_create_attr`` when creating servers. Possible dictionary entries in
In our :ref:`example <cloudscale-examples>` below you can see how you use
``ex_create_attr`` when creating servers. Possible dictionary entries in
``ex_create_attr`` are:

- ``ssh_keys`` (``list`` of ``str``) - A list of SSH public keys.
Expand Down Expand Up @@ -65,10 +65,10 @@ API Docs
--------

.. autoclass:: libcloud.compute.drivers.cloudscale.CloudscaleNodeDriver
:members: create_node, list_images, list_nodes, list_sizes,
:members: create_node, list_images, list_nodes, list_sizes,
wait_until_running, reboot_node, ex_start_node, ex_stop_node,
ex_node_by_uuid, destroy_node
:undoc-members:
:undoc-members:

.. _`cloudscale.ch`: https://www.cloudscale.ch
.. _`cloudscale.ch API`: https://www.cloudscale.ch/en/api/v1
Expand Down
2 changes: 1 addition & 1 deletion docs/compute/drivers/digital_ocean.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ API v2.0


.. _`DigitalOcean`: https://www.digitalocean.com/
.. _`reached end of life on November 9, 2015`: https://developers.digitalocean.com/documentation/changelog/api-v1/sunsetting-api-v1/
.. _`reached end of life on November 9, 2015`: https://developers.digitalocean.com/documentation/changelog/api-v1/sunsetting-api-v1/
2 changes: 1 addition & 1 deletion docs/compute/drivers/dimensiondata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ Debugging Tips
ValueError: Invalid attribute name u'xmlns:xsi'

*Solution*:
- Upgrade to python version 2.7.12 and above
- Upgrade to python version 2.7.12 and above
2 changes: 1 addition & 1 deletion docs/compute/drivers/nttcis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ Debugging Tips
ValueError: Invalid attribute name u'xmlns:xsi'

*Solution*:
- Upgrade to python version 2.7.12 and above
- Upgrade to python version 2.7.12 and above
8 changes: 4 additions & 4 deletions docs/compute/drivers/openstack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Among many other private clouds, it also powers Rackspace's Public Cloud.
Selecting the Nova API version
------------------------------

Along with your connection criteria, you can specify the Nova version with `api_version`,
Along with your connection criteria, you can specify the Nova version with `api_version`,
currently supported versions of Nova are:

- 1.0
Expand Down Expand Up @@ -94,15 +94,15 @@ Available arguments:
is provided, this step is skipped and the provided value is used directly.
* ``ex_force_network_url`` - Base URL to the OpenStack neutron API endpoint. By default,
driver obtains API endpoint URL from the server catalog, but if this argument
is provided, this step is skipped and the provided value is used directly. Only valid
is provided, this step is skipped and the provided value is used directly. Only valid
in case of api_version >= 2.0.
* ``ex_force_image_url`` - Base URL to the OpenStack glance API endpoint. By default,
driver obtains API endpoint URL from the server catalog, but if this argument
is provided, this step is skipped and the provided value is used directly. Only valid
is provided, this step is skipped and the provided value is used directly. Only valid
in case of api_version >= 2.0.
* ``ex_force_volume_url`` - Base URL to the OpenStack cinder API endpoint. By default,
driver obtains API endpoint URL from the server catalog, but if this argument
is provided, this step is skipped and the provided value is used directly. Only valid
is provided, this step is skipped and the provided value is used directly. Only valid
in case of api_version >= 2.0.
* ``ex_force_microversion`` - Microversion of the API to interact with OpenStack.
Only valid in case of api_version >= 2.0.
Expand Down
2 changes: 0 additions & 2 deletions docs/compute/drivers/outscale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -355,5 +355,3 @@ API Access Rules
* ``ex_delete_api_access_rule`` - Returns a ``bool``
* ``ex_read_api_access_rules`` - Returns a ``list`` of ``dict``
* ``ex_update_api_access_rule`` - Returns a ``dict``


2 changes: 1 addition & 1 deletion docs/container/drivers/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ API Docs
:members:
:inherited-members:

.. _`Docker`: https://docker.io/
.. _`Docker`: https://docker.io/
4 changes: 2 additions & 2 deletions docs/container/drivers/ecs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To provide API key access, you should apply one of the roles:

Instantiating the driver
------------------------

.. literalinclude:: /examples/container/ecs/instantiate_driver.py
:language: python

Expand Down Expand Up @@ -55,4 +55,4 @@ API Docs
:inherited-members:


.. _`AWS`: https://aws.amazon.com/
.. _`AWS`: https://aws.amazon.com/
2 changes: 1 addition & 1 deletion docs/container/drivers/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ This chapter includes links to driver (provider) specific documentation pages.
:glob:
:maxdepth: 1

*
*
2 changes: 1 addition & 1 deletion docs/container/drivers/rancher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ For the first version of this driver, Mario Loria of Arroyo Networks wrote most
of the code. He received help from Anthony Shaw, a core libcloud contributor
and Vincent Fiduccia, software architect at Rancher Labs.

.. _`Rancher`: https://rancher.com/
.. _`Rancher`: https://rancher.com/
2 changes: 1 addition & 1 deletion docs/container/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Docker Hub Client :class:`~libcloud.container.utils.docker.HubClient` is a share
You can use this class for fetching images to deploy to services like ECS

.. literalinclude:: /examples/container/docker_hub.py
:language: python
:language: python
2 changes: 1 addition & 1 deletion docs/container/supported_providers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Provider Matrix
Supported Methods
-----------------

.. include:: _supported_methods.rst
.. include:: _supported_methods.rst
20 changes: 10 additions & 10 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,20 @@ And most importantly, follow the existing style in the file you are editing and
Git pre-commit hook
-------------------

To make complying with our style guide easier, we provide a git pre-commit hook
which automatically checks modified Python files for violations of our style
guide.

You can install it by running following command in the root of the repository
checkout:
We use `pre-commit` configuration with `prek` to run formatting and linting
hooks before commits. Install the tooling (including ``prek``) and register the
git hook from the repository root:

.. sourcecode:: bash

ln -s contrib/pre-commit.sh .git/hooks/pre-commit
uv sync --extra lint
uv run prek install

To run all hooks on all files:

.. sourcecode:: bash

After you have installed this hook it will automatically check modified Python
files for violations before a commit. If a violation is found, commit will be
aborted.
uv run prek run -a

.. _code-conventions:

Expand Down
2 changes: 1 addition & 1 deletion docs/dns/drivers/buddyns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ API Docs
:members:
:inherited-members:

.. https://www.buddyns.com/support/api/v2/
.. https://www.buddyns.com/support/api/v2/
4 changes: 2 additions & 2 deletions docs/dns/drivers/godaddy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Instantiating the driver

Before you instantiate a driver, you will need a GoDaddy account.

Once you have an account you need to request a Production key on the GoDaddy API website:
https://developer.godaddy.com/getstarted#access
Once you have an account you need to request a Production key on the GoDaddy API website:
https://developer.godaddy.com/getstarted#access

You can then use these details to instantiate a driver with the arguments:

Expand Down
2 changes: 1 addition & 1 deletion docs/dns/drivers/luadns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ API Docs
:members:
:inherited-members:

.. _`Luadns`: http://luadns.com/
.. _`Luadns`: http://luadns.com/
6 changes: 3 additions & 3 deletions docs/dns/drivers/rcodezero.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ RcodeZero DNS Driver Documentation
:width: 300
:target: https://www.rcodezero.at/en

`RcodeZero`_ is a European Anycast DNS service provided by nic.at.
`RcodeZero`_ is a European Anycast DNS service provided by nic.at.

Supported Features:

- more than 35 nodes
- two seperate clouds with different ASes
- two seperate clouds with different ASes
- full IPv4/IPv6 support
- primary as well as secondary Nameservers
- DNSSEC signing
Expand All @@ -38,5 +38,5 @@ API Docs

.. autoclass:: libcloud.dns.drivers.rcodezero.RcodeZeroDNSDriver
:members:

.. _`RcodeZero`: https://my.rcodezero.at/en
1 change: 0 additions & 1 deletion docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,3 @@ Example #2 (code):

import libcloud
libcloud.__version__

Loading