Skip to content

Commit

Permalink
Add python packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Vanden Broeck committed Sep 27, 2024
1 parent c399caa commit fe1a257
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 7 deletions.
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ RUN apk add --no-cache python3 python3-dev py3-pip gcc jq \

RUN python3 -m venv --upgrade-deps /opt/venv

COPY requirements.txt /opt
COPY ansible_collection_helper.py /opt/
COPY templates /opt/templates/

RUN /opt/venv/bin/pip install -r /opt/requirements.txt
COPY . /usr/local/src/ansible_collection_helper
RUN /opt/venv/bin/pip install --no-cache-dir /usr/local/src/ansible_collection_helper &&\
rm -rf /usr/local/src/ansible_collection_helper
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: 2024 Dalibo
#
# SPDX-License-Identifier: GPL-3.0-or-later
[build-system]
requires = ["setuptools >= 61.0", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "ansible_collection_helper"
description = "Helper to manage Ansible collection"
readme = "README.md"
requires-python = ">=3.11, <4"
license = { text = "GPLv3" }
authors = [{ name = "Dalibo SCOP", email = "[email protected]" }]
keywords = [
"ansible",
"command-line",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Topic :: System :: Systems Administration",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
]
dynamic = ["version", "dependencies"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[project.urls]
Source = "https://github.com/dalibo/docker-dind-molecule/"
Tracker = "https://github.com/dalibo/docker-dind-molecule/"


[project.scripts]
ansible_collection_helper = "ansible_collection_helper:helper.main"

[tool.setuptools_scm]
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@

import yaml
from ansible.cli.doc import DocCLI
from jinja2 import Environment, FileSystemLoader
from jinja2 import Environment, PackageLoader

env = Environment(loader=FileSystemLoader((Path(__file__).parent / "templates")))
from . import __name__ as pkgname

env = Environment(
loader=PackageLoader(package_name=pkgname, package_path="templates"),
trim_blocks=True,
lstrip_blocks=True,
)
template = env.get_template("readme.jinja2")


Expand Down
File renamed without changes.

0 comments on commit fe1a257

Please sign in to comment.