cogeol

Align projects with supported Python versions - automated with endoflife.date

https://github.com/open-nudge/cogeol

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.4%) to scientific vocabulary

Keywords

automation endoflife-date eol github-actions pyproject python tooling
Last synced: 4 months ago · JSON representation ·

Repository

Align projects with supported Python versions - automated with endoflife.date

Basic Info
Statistics
  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
automation endoflife-date eol github-actions pyproject python tooling
Created 6 months ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Codeowners Security Support Governance Roadmap

README.md

cogeol

Align with supported Python versions - automated with endoflife.date

![PyPI - Python Version](https://img.shields.io/pypi/v/cogeol?style=for-the-badge&label=release&labelColor=grey&color=blue) ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fopen-nudge%2Fcogeol%2Fmain%2Fpyproject.toml&style=for-the-badge&label=python&labelColor=grey&color=blue) ![License](https://img.shields.io/badge/License-Apache_2.0-blue?style=for-the-badge) ![Coverage Hardcoded](https://img.shields.io/badge/coverage-100%25-green?style=for-the-badge) ![OSSF-Scorecard Score](https://img.shields.io/ossf-scorecard/github.com/open-nudge/cogeol?style=for-the-badge&label=OSSF)

Features 🚀 Quick start 📚 Documentation 🤝 Contribute 👍 Adopters 📜 Legal


Features

cogeol is a library which allows you to:

  • Works with any file format (e.g. updating Python versions in CI/CD tests)
  • No need to track Python EOL dates — cogeol does it for you
  • Align with Scientific Python SPEC0: cogeol will allow you to align your project to the three latest supported Python versions
  • Caching: retrieves data from https://endoflife.date/ and stores it locally to minimize network requests
  • Based on cog: Manage versions of Python by statically generated code (see examples below!)

Quick start

Installation

```sh

pip install cogeol ```

Usage

[!TIP] Check out the documentation for all available functionalities and public-facing API.

  1. Open pyproject.toml of your project and find necessary to have requires-python field.
  2. Update it as follows (comments are crucial!):

```toml

[[[cog

import cog

import cogeol

cycle = cogeol.scientific()[-1]["cycle"]

cog.out(f'requires-python = ">={cycle}"')

]]]

requires-python = ">=3.9"

[[[end]]]

```

Now run the following from the command line:

```sh

cog -c -r pyproject.toml ```

Now your requires-python field will be updated to the latest supported Python version!

For example (Python 3.11 is the latest supported version at the time of writing):

```toml

[[[cog

import cog

import cogeol

cycle = cogeol.scientific()[-1]["cycle"]

cog.out(f'requires-python = ">={cycle}"')

]]]

requires-python = ">=3.11"

[[end]]

```

[!NOTE] Please notice a checksum, which verifies consistency of the changes at each run

Examples

Specifying Python version classifiers (click me)   You can automate the classifiers in your `pyproject.toml` file like this: ```toml # [[[cog # import cog # import cogeol # # for version in reversed(cogeol.scientific()): # cycle = version["cycle"] # cog.outl(f' "Programming Language :: Python :: {cycle}",') # ]]] "Programming Language :: Python :: 3.11", # [[[end]]] ``` Now run the following from the command line: ```sh > cog -c -r pyproject.toml ``` and you should see the following (__notice all versions are present!__): ```toml # [[[cog # import cog # import cogeol # # for version in reversed(cogeol.scientific()): # cycle = version["cycle"] # cog.outl(f' "Programming Language :: Python :: {cycle}",') # ]]] "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", # [[[end]]] (sum: FeG7grp2Dw) ```
Caching (click me)   Let's assume you have the following code snippet in `github-workflow.yml`: ```yaml ... jobs: tests-reusable: strategy: matrix: python: # # DO NOT EDIT UNTIL end marker # # [[[cog # import cog # import cogeol # # for version in reversed(cogeol.scientific()): # cycle = version['cycle'] # cog.outl(f' - "{cycle}"') # ]]] - "3.11" # [[[end]]] (sum: l3d2zGv79j) ``` in addition to your code in `pyproject.toml` using `cogeol`. Now, if you run: ```sh > cog -c -r pyproject.toml github-workflow.yml ``` The following will happen: - Both files will be updated with appropriate Python versions - __Only one call to [End of Life Date](https://endoflife.date) will be made__ (the results are cached on disk) Next time you run the same command, the results will be read from the cache
Advanced (click me)   For more examples check out this project's: - `pyproject.toml` file (see [here](https://github.com/open-nudge/cogeol/blob/main/pyproject.toml)) - Tests of the last three versions in GitHub Actions workflow (see [here](https://github.com/open-nudge/cogeol/blob/main/.github/workflows/tests-reusable.yml))

Contribute

We welcome your contributions! Start here:

Legal

  • This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
  • This project is copyrighted by open-nudge - the appropriate copyright notice is included in each file.

Owner

  • Name: opennudge
  • Login: open-nudge
  • Kind: organization
  • Email: opensource@opennudge.com

Citation (CITATION.cff)

# SPDX-FileCopyrightText: © 2024 open-nudge <https://github.com/open-nudge>
# SPDX-FileContributor: szymonmaszke <github@maszke.co>
#
# SPDX-License-Identifier: Apache-2.0

---
cff-version: "1.2.0"
abstract: >-
  Align with supported Python versions - automated with endoflife.date
message: "If you use this software, please cite it as below."
authors:
  - family-names: "open-nudge"
url: "https://github.com/open-nudge/cogeol"
repository-code: "https://github.com/open-nudge/cogeol"
title: "cogeol"
license: "Apache-2.0"
keywords:
  - "python"

GitHub Events

Total
  • Create event: 11
  • Release event: 3
  • Issues event: 10
  • Watch event: 4
  • Delete event: 3
  • Push event: 5
  • Pull request event: 8
Last Year
  • Create event: 11
  • Release event: 3
  • Issues event: 10
  • Watch event: 4
  • Delete event: 3
  • Push event: 5
  • Pull request event: 8

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 121 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: cogeol

Align with supported Python versions - automated with endoflife.date

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 121 Last month
Rankings
Dependent packages count: 9.8%
Average: 32.4%
Dependent repos count: 54.9%
Maintainers (1)
Last synced: 5 months ago

Dependencies

.github/actions/git-setup/action.yml actions
.github/actions/pdm-compatibility/action.yml actions
.github/actions/pdm-setup/action.yml actions
  • open-nudge/opentemplate/.github/actions/pdm-compatibility main composite
  • pdm-project/setup-pdm 94a823180e06fcde4ad29308721954a521c96ed0 composite
.github/actions/pull-request/action.yml actions
.github/actions/release-sbom-setup/action.yml actions
.github/actions/sarif-upload/action.yml actions
  • actions/upload-artifact ea165f8d65b6e75b540449e92b4886f43607fa02 composite
  • github/codeql-action/upload-sarif fca7ace96b7d713c7035871441bd52efbe39e27e composite
.github/actions/template-setup/action.yml actions
  • pdm-project/setup-pdm 94a823180e06fcde4ad29308721954a521c96ed0 composite
.github/workflows/cache-item-reusable.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • open-nudge/opentemplate/.github/actions/pdm-setup main composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/cache-reusable.yml actions
.github/workflows/cache-test.yml actions
.github/workflows/cache.yml actions
.github/workflows/citation-renovate.yml actions
.github/workflows/citation-reusable.yml actions
.github/workflows/citation.yml actions
.github/workflows/code-renovate.yml actions
.github/workflows/code-reusable.yml actions
.github/workflows/code.yml actions
.github/workflows/commit-renovate.yml actions
.github/workflows/commit-reusable.yml actions
.github/workflows/commit.yml actions
.github/workflows/docs-renovate.yml actions
.github/workflows/docs-reusable.yml actions
.github/workflows/docs.yml actions
.github/workflows/generation-renovate.yml actions
.github/workflows/generation-reusable.yml actions
.github/workflows/generation-update-reusable.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • open-nudge/opentemplate/.github/actions/git-setup main composite
  • open-nudge/opentemplate/.github/actions/pdm-setup main composite
  • open-nudge/opentemplate/.github/actions/pull-request main composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/generation-update-test.yml actions
.github/workflows/generation-update.yml actions
.github/workflows/generation.yml actions
.github/workflows/github-actionlint.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • docker://rhysd/actionlint 1.7.1 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/github-actions-reusable.yml actions
.github/workflows/github-actions.yml actions
.github/workflows/github-all-renovate.yml actions
.github/workflows/github-renovate-reusable.yml actions
.github/workflows/github-renovate.yml actions
.github/workflows/github-reusable.yml actions
.github/workflows/github-workflows-reusable.yml actions
.github/workflows/github-workflows.yml actions
.github/workflows/github.yml actions
.github/workflows/harden.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/ini-renovate.yml actions
.github/workflows/ini-reusable.yml actions
.github/workflows/ini.yml actions
.github/workflows/labeler.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/labeler 8558fd74291d67161a8a78ce36a881fa63b766a9 composite
  • github/issue-labeler c1b0f9f52a63158c4adc09425e858e87b32e9685 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/legal-renovate.yml actions
.github/workflows/legal-reusable.yml actions
.github/workflows/legal.yml actions
.github/workflows/markdown-renovate.yml actions
.github/workflows/markdown-reusable.yml actions
.github/workflows/markdown.yml actions
.github/workflows/policy.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • siderolabs/conform 43d9fb6d85d5f01b391245805eefd258db160197 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/pre-commit-config.yml actions
.github/workflows/pre-commit-hooks.yml actions
.github/workflows/pre-commit-reusable.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • open-nudge/opentemplate/.github/actions/git-setup main composite
  • open-nudge/opentemplate/.github/actions/pdm-setup main composite
  • open-nudge/opentemplate/.github/actions/pull-request main composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/pre-commit-update.yml actions
.github/workflows/pre-commit.yml actions
.github/workflows/prose.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
.github/workflows/pull-request.yml actions
  • amannn/action-semantic-pull-request 0723387faaf9b38adef4775cd42cfd5155ed6017 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/pyproject-renovate.yml actions
.github/workflows/pyproject-reusable.yml actions
.github/workflows/pyproject.yml actions
.github/workflows/python-renovate.yml actions
.github/workflows/python-reusable.yml actions
.github/workflows/python.yml actions
.github/workflows/release-check-renovate.yml actions
.github/workflows/release-check-reusable.yml actions
.github/workflows/release-check.yml actions
.github/workflows/release-sarifs-reusable.yml actions
.github/workflows/release-sbom-attest-reusable.yml actions
  • actions/attest-sbom 115c3be05ff3974bcbd596578934b3f9ce39bf68 composite
  • actions/download-artifact d3f86a106a0bac45b974a628896c90dbdf5c8093 composite
  • actions/upload-artifact ea165f8d65b6e75b540449e92b4886f43607fa02 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/release-sbom-run-reusable.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/upload-artifact ea165f8d65b6e75b540449e92b4886f43607fa02 composite
  • open-nudge/opentemplate/.github/actions/git-setup main composite
  • open-nudge/opentemplate/.github/actions/pdm-compatibility main composite
  • open-nudge/opentemplate/.github/actions/pdm-setup main composite
  • open-nudge/opentemplate/.github/actions/release-sbom-setup main composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/release-sboms-reusable.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/upload-artifact ea165f8d65b6e75b540449e92b4886f43607fa02 composite
  • open-nudge/opentemplate/.github/actions/release-sbom-setup main composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/release-sboms-test.yml actions
.github/workflows/release-slsa-provenance-reusable.yml actions
  • actions/download-artifact d3f86a106a0bac45b974a628896c90dbdf5c8093 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/release-slsa-provenance-test.yml actions
.github/workflows/release-upload.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/download-artifact d3f86a106a0bac45b974a628896c90dbdf5c8093 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/release.yml actions
  • actions/download-artifact d3f86a106a0bac45b974a628896c90dbdf5c8093 composite
  • actions/upload-artifact ea165f8d65b6e75b540449e92b4886f43607fa02 composite
  • pypa/gh-action-pypi-publish 76f52bc884231f62b9a034ebfe128415bbaabdfc composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/renovate.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
  • suzuki-shunsuke/github-action-renovate-config-validator c22827f47f4f4a5364bdba19e1fe36907ef1318e composite
.github/workflows/run-check-reusable.yml actions
.github/workflows/run-reusable.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/download-artifact d3f86a106a0bac45b974a628896c90dbdf5c8093 composite
  • actions/upload-artifact ea165f8d65b6e75b540449e92b4886f43607fa02 composite
  • open-nudge/opentemplate/.github/actions/git-setup main composite
  • open-nudge/opentemplate/.github/actions/pdm-compatibility main composite
  • open-nudge/opentemplate/.github/actions/pdm-setup main composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/security-osv-scanner-reusable.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • google/osv-scanner/actions/scanner a2a23858b9650035f019219937f91ae615474b4d composite
  • open-nudge/opentemplate/.github/actions/sarif-upload main composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/security-osv-scanner-update.yml actions
.github/workflows/security-osv-scanner.yml actions
.github/workflows/security-scorecard-reusable.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/upload-artifact ea165f8d65b6e75b540449e92b4886f43607fa02 composite
  • github/codeql-action/upload-sarif fca7ace96b7d713c7035871441bd52efbe39e27e composite
  • ossf/scorecard-action 05b42c624433fc40578a4040d5cf5e36ddca8cde composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/security-scorecard-test.yml actions
.github/workflows/security-scorecard-update.yml actions
.github/workflows/security-secrets.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
  • trufflesecurity/trufflehog 90694bf9af66e7536abc5824e7a87246dbf933cb composite
.github/workflows/security-semgrep-renovate.yml actions
.github/workflows/security-semgrep-reusable.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • open-nudge/opentemplate/.github/actions/pdm-compatibility main composite
  • open-nudge/opentemplate/.github/actions/pdm-setup main composite
  • open-nudge/opentemplate/.github/actions/sarif-upload main composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/security-semgrep-update.yml actions
.github/workflows/security-semgrep.yml actions
.github/workflows/shell-renovate.yml actions
.github/workflows/shell-reusable.yml actions
.github/workflows/shell.yml actions
.github/workflows/stale.yml actions
  • actions/stale 5bef64f19d7facfb25b37b414482c7164d639639 composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
.github/workflows/template-update-reusable.yml actions
.github/workflows/template-update.yml actions
.github/workflows/tests-renovate.yml actions
.github/workflows/tests-reusable.yml actions
.github/workflows/tests.yml actions
.github/workflows/typing-renovate.yml actions