From ab04c5c5792545a450fd4da25cfa45c90f01ac33 Mon Sep 17 00:00:00 2001 From: Frantisek Lachman Date: Tue, 18 Apr 2023 14:21:09 +0200 Subject: [PATCH 1/2] Prepare an example of monorepo setup Signed-off-by: Frantisek Lachman --- .packit.yaml | 57 ++++++++++++++++-------- hello/LICENSE | 21 +++++++++ hello/README.md | 15 +++++++ hello.spec => hello/hello.spec | 0 {hello_world => hello/hello}/__init__.py | 0 setup.cfg => hello/setup.cfg | 2 +- setup.py => hello/setup.py | 0 world/LICENSE | 21 +++++++++ world/README.md | 15 +++++++ world/setup.cfg | 33 ++++++++++++++ world/setup.py | 8 ++++ world/world.spec | 34 ++++++++++++++ world/world/__init__.py | 26 +++++++++++ 13 files changed, 213 insertions(+), 19 deletions(-) create mode 100644 hello/LICENSE create mode 100644 hello/README.md rename hello.spec => hello/hello.spec (100%) rename {hello_world => hello/hello}/__init__.py (100%) rename setup.cfg => hello/setup.cfg (96%) rename setup.py => hello/setup.py (100%) create mode 100644 world/LICENSE create mode 100644 world/README.md create mode 100644 world/setup.cfg create mode 100644 world/setup.py create mode 100644 world/world.spec create mode 100644 world/world/__init__.py diff --git a/.packit.yaml b/.packit.yaml index dce8acc3..3a6aaadb 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -1,21 +1,48 @@ --- packit_instances: ["prod", "stg"] -specfile_path: hello.spec -files_to_sync: - - .packit.yaml - - hello.spec -upstream_package_name: hello -downstream_package_name: hello -# actions: -# post-upstream-clone: "python3 setup.py sdist --dist-dir ." -# current_version_command: ["python3", "setup.py", "--version"] -# create_tarball_command: ["python3", "setup.py", "sdist", "--dist-dir", "."] + +packages: + + hello: + downstream_package_name: hello + upstream_package_name: hello + paths: + - ./hello + specfile_path: hello.spec + files_to_sync: + - hello.spec + + world: + downstream_package_name: world + upstream_package_name: world + paths: + - ./world + specfile_path: world.spec + files_to_sync: + - world.spec + jobs: - job: copr_build trigger: pull_request + packages: + - hello + - world + targets: + - fedora-rawhide + +- job: copr_build + trigger: pull_request + packages: + - hello targets: - - fedora-stable-x86_64 - - fedora-rawhide-x86_64 + - fedora-branched + +- job: copr_build + trigger: pull_request + packages: + - world + targets: + - fedora-stable - job: copr_build trigger: release @@ -28,12 +55,6 @@ jobs: targets: - fedora-stable -- job: tests - trigger: pull_request - targets: - - fedora-stable-x86_64 - - fedora-rawhide-x86_64 - - job: propose_downstream trigger: release packit_instances: ["stg"] diff --git a/hello/LICENSE b/hello/LICENSE new file mode 100644 index 00000000..f89a87a3 --- /dev/null +++ b/hello/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Red Hat + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/hello/README.md b/hello/README.md new file mode 100644 index 00000000..b9e343ce --- /dev/null +++ b/hello/README.md @@ -0,0 +1,15 @@ +# hello-world + +The simplest python CLI tool used to demonstrate packit service functionality. It will make your day. + + $ hello world! + Hello world! + +## How to? + +Just open a pull request on this repository and packit service will build your changes +and provide an RPM repository using your pull request as a source. + +Follow the steps provided by the packit service and then install this tool like this: + + $ dnf install hello diff --git a/hello.spec b/hello/hello.spec similarity index 100% rename from hello.spec rename to hello/hello.spec diff --git a/hello_world/__init__.py b/hello/hello/__init__.py similarity index 100% rename from hello_world/__init__.py rename to hello/hello/__init__.py diff --git a/setup.cfg b/hello/setup.cfg similarity index 96% rename from setup.cfg rename to hello/setup.cfg index f2c439e3..1d6f9575 100644 --- a/setup.cfg +++ b/hello/setup.cfg @@ -30,4 +30,4 @@ include_package_data = True [options.entry_points] console_scripts = - hello=hello_world:main + hello=hello:main diff --git a/setup.py b/hello/setup.py similarity index 100% rename from setup.py rename to hello/setup.py diff --git a/world/LICENSE b/world/LICENSE new file mode 100644 index 00000000..f89a87a3 --- /dev/null +++ b/world/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Red Hat + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/world/README.md b/world/README.md new file mode 100644 index 00000000..fd5396b2 --- /dev/null +++ b/world/README.md @@ -0,0 +1,15 @@ +# hello-world + +The simplest python CLI tool used to demonstrate packit service functionality. It will make your day. + + $ world Hello + Hello world! + +## How to? + +Just open a pull request on this repository and packit service will build your changes +and provide an RPM repository using your pull request as a source. + +Follow the steps provided by the packit service and then install this tool like this: + + $ dnf install world diff --git a/world/setup.cfg b/world/setup.cfg new file mode 100644 index 00000000..4d29c071 --- /dev/null +++ b/world/setup.cfg @@ -0,0 +1,33 @@ +[metadata] +name = world +version = 0.1.0 +url = https://github.com/packit/hello +description = Nice and a polite tool +long_description = file: README.md +long_description_content_type = text/markdown +author = Red Hat +author_email = user-cont-team@redhat.com +license = MIT +license_file = LICENSE +classifiers = + Environment :: Console + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 +keywords = + world + + +[options] +packages = find: +python_requires = >=3.6 +include_package_data = True + +[options.entry_points] +console_scripts = + world=world:main diff --git a/world/setup.py b/world/setup.py new file mode 100644 index 00000000..de4f1079 --- /dev/null +++ b/world/setup.py @@ -0,0 +1,8 @@ +#!/usr/bin/python3 + +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + +from setuptools import setup + +setup() diff --git a/world/world.spec b/world/world.spec new file mode 100644 index 00000000..6171fce6 --- /dev/null +++ b/world/world.spec @@ -0,0 +1,34 @@ +Name: world +Version: 0.1.0 +Release: 1%{?dist} +Summary: Nice and a polite tool to make your day +License: MIT +URL: https://github.com/packit-service/hello-world +Source0: world-%{version}.tar.gz +BuildArch: noarch +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%description +%{summary} + + +%prep +%autosetup -n %{name}-%{version} + +%build +%py3_build + +%install +%py3_install + +%files +%license LICENSE +%{_bindir}/world +%{python3_sitelib}/* +%doc README.md + +%changelog +* Thu May 02 2019 Tomas Tomecek - 0.1.0-1 +- initial upstream release: 0.1.0 + diff --git a/world/world/__init__.py b/world/world/__init__.py new file mode 100644 index 00000000..924f00f6 --- /dev/null +++ b/world/world/__init__.py @@ -0,0 +1,26 @@ +#!/usr/bin/python3 + +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + +__version__ = "0.1.0" + +import sys + + +def usage(): + print( + "Usage: world GREETING\n" + ) + sys.exit(3) + + +def main(): + args_n = len(sys.argv) + if args_n <= 1 or args_n > 2: + usage() + print(f"{sys.argv[1]} world!") + + +if __name__ == '__main__': + main() From 5adff42ef34e1fef596c8d16d196697ced613c16 Mon Sep 17 00:00:00 2001 From: Maja Massarini Date: Tue, 1 Aug 2023 15:03:10 +0200 Subject: [PATCH 2/2] Looking for what makes CoprBuildStartEvent disappear --- .packit.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index 3a6aaadb..6bba5df6 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -22,13 +22,13 @@ packages: - world.spec jobs: -- job: copr_build - trigger: pull_request - packages: - - hello - - world - targets: - - fedora-rawhide +#- job: copr_build +# trigger: pull_request +# packages: +# - hello +# - world +# targets: +# - fedora-rawhide - job: copr_build trigger: pull_request @@ -37,12 +37,12 @@ jobs: targets: - fedora-branched -- job: copr_build - trigger: pull_request - packages: - - world - targets: - - fedora-stable +#- job: copr_build +# trigger: pull_request +# packages: +# - world +# targets: +# - fedora-stable - job: copr_build trigger: release