Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

C2C CI utils

Commands:

  • c2cciutils: some generic tools.
  • c2cciutils-checks: Run the checks on the code (those checks don't need any project dependencies).
  • c2cciutils-audit: Do the audit, the main difference with checks is that it can change between runs on the same code.
  • c2cciutils-publish: Publish the project.
  • c2cciutils-clean: Delete Docker images on Docker Hub after corresponding branch have been deleted.
  • c2cciutils-google-calendar: Tool to test the google credentials for calendar API and refresh them if needed. See c2cciutils-google-calendar -h for more information.

New project

The content of example-project can be a good base for a new project.

Secrets

In the CI we needs to have the following secrets::

  • HAS_SECRETS to be set to 'HAS_SECRETS', to avoid error errors from external pull requests, already set globally on camtocamp organisation.
  • GOPASS_CI_GITHUB_TOKEN and CI_GPG_PRIVATE_KEY required to initialise the gopass password store, the secrets axists in the camptocamp organisation but not shared on all project, then you should add your project to the shared list.

Use locally, in the projects that use c2cciutils

Install it: python3 -m pip install --user --requirement ci/requirements.txt Run the checkers: c2cciutils-checks [--fix] [--stop] [--check CHECK] Dry run publish: GITHUB_REF=... c2cciutils-publish --dry-run ...

Configuration

You can get the current configuration with c2cciutils --get-config, the default configuration depends on your project.

You can override the configuration with the file ci/config.yaml.

At the base of the configuration you have:

  • version: Contains some regular expressions to find the versions branches and tags, and to convert them into application versions.
  • checks: The checkers configuration, see c2cciutils/checks.py for more information.
  • audit: The audit configuration, see c2cciutils/audit.py for more information.
  • publish: The publish configuration, see c2cciutils/publish.py for more information.

Many actions can be disabled by setting the corresponding configuration part to False.

Checks

The configuration profile considers we use a project with:

  • The following workflows:
    • Continuous integration,
    • Rebuild on all supported branch,
    • Audit for security issues on all supported branches,
    • Backport between all supported branches,
    • Clean Docker hub tags,
    • Auto review.
  • A SECURITY.md file.

It will check that:

  • All the workflows are conform on what we expect,
  • All the workflows are completely configured for all the versions present in SECURITY.md file.
  • The code is conform with the black and isort rules.
  • The gitattributes are valid.
  • All text files end with an empty line.

SECURITY.md

The SECURITY.md file should contains the security policy of the repository, espessially the end of support dates.

For compatibility with c2cciutils it should contain an array with at least the columns Version and Supported Until. The Version column will contain the concerned version. The Supported Until will contains the date of end of support dd/mm/yyyy. It can also contain the following sentences:

  • Unsupported: no longer supported => no audit, no rebuild.
  • Best effort: the support is ended, it is still rebuilt and audited but this can be can stopped without any notice.
  • To be defined: not yet released or the date will be set related of an other project release date (like for GeoMapFish).

See also GitHub Documentation

IDE

The IDE should be configured as:

  • using black and isort without any arguments,
  • using the editorconfig configuration.

VScode

Select a formatter:

  • CTRL+MAJ+P
  • Format document With...
  • Configure Default Formatter...
  • Select the formatter

Publishing

To pypi

When publishing, the version computed from arguments or GITHUB_REF is put in environment variable VERSION, thus you should use it in setup.py, example:

VERSION = os.environ.get("VERSION", "1.0.0")

The config is like this:

versions:
  # List of kinds of versions you want to publish, that can be:
  # rebuild (specified with --type),
  # version_tag, version_branch, feature_branch, feature_tag (for pull request)

To Docker registry

The config is like this:

latest: True
images:
    - name: # The base name of the image we want to publish
repository:
    <internal_name>:
        'server': # The fqdn name of the server if not Docker hub
        'version':# List of kinds of versions you want to publish, that can be: rebuild (specified using --type),
            # version_tag, version_branch, feature_branch, feature_tag (for pull request)
        'tags':# List of tags we want to publish interpreted with `template(version=version)`
            # e.g. if you use `{version}-lite` when you publish the version `1.2.3` the source tag
            # (that should be built by the application build) is `latest-lite`, and it will be published
            # with the tag `1.2.3-lite`.
        'group':# If your images are published by different jobs you can separate them in different groups
            # and publish them with `c2cciutils-publish --group=<group>`

By default the last line of the SECURITY.md file will be published (docker) with the tag latest. Set latest to False to disable it.

With the c2cciutils-clean the images on Docker hub for feature_branch will be removed on branch removing.

Metadata

Release files for c2cciutils 1.2.35.dev61

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for c2cciutils 1.2.35.dev61
File Size Uploaded Provenance Actions
c2cciutils-1.2.35.dev61.tar.gz 45.1 kB Without provenance Details for c2cciutils-1.2.35.dev61.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for c2cciutils 1.2.35.dev61
File Interpreter ABI Platform Actions
c2cciutils-1.2.35.dev61-py3-none-any.whl Python 3 none any Details for c2cciutils-1.2.35.dev61-py3-none-any.whl

Total release size: 98.0 kB

Release files / c2cciutils-1.2.35.dev61.tar.gz

Download URL c2cciutils-1.2.35.dev61.tar.gz
Size 45.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a92b7234a8e1ad65000dc3273dbd61b4ce6031dbcf19cda90f589b353e7a3415
BLAKE2b-256 checksum
How to use checksums
a820d84d40d1ff55186776bfbc1c577e1fcb93cffabd7d1e9d02c21d949be443
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.11.16

Release files / c2cciutils-1.2.35.dev61-py3-none-any.whl

Download URL c2cciutils-1.2.35.dev61-py3-none-any.whl
Size 52.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
426e4e5911beced6bcd23a9f1b584e787dfe25b3c2924ee2fa2db8562f559de1
BLAKE2b-256 checksum
How to use checksums
40cafcc7bef74fb3835f2605c4383264e523d715f13cdd93d974221aefcd259b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.11.16

Security for c2cciutils 1.2.35.dev61

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page