Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/monorepo fixes #1599

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
57 changes: 39 additions & 18 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]
Expand Down
21 changes: 21 additions & 0 deletions hello/LICENSE
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 15 additions & 0 deletions hello/README.md
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.cfg → hello/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ include_package_data = True

[options.entry_points]
console_scripts =
hello=hello_world:main
hello=hello:main
File renamed without changes.
21 changes: 21 additions & 0 deletions world/LICENSE
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 15 additions & 0 deletions world/README.md
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions world/setup.cfg
Original file line number Diff line number Diff line change
@@ -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 = [email protected]
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
8 changes: 8 additions & 0 deletions world/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/python3

# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT

from setuptools import setup

setup()
34 changes: 34 additions & 0 deletions world/world.spec
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> - 0.1.0-1
- initial upstream release: 0.1.0

26 changes: 26 additions & 0 deletions world/world/__init__.py
Original file line number Diff line number Diff line change
@@ -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()