-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from lachmanfrantisek/packaging
Introduce packaging
- Loading branch information
Showing
8 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ref-names: $Format:%D$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Needed for setuptools-scm-git-archive | ||
.git_archival.txt export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
BASE_IMAGE := registry.fedoraproject.org/fedora:29 | ||
TEST_TARGET := ./tests/ | ||
PY_PACKAGE := ogr | ||
OGR_IMAGE := ogr | ||
|
||
build: recipe.yaml | ||
sudo ansible-bender build --build-volumes $(CURDIR):/src:Z -- ./recipe.yaml $(BASE_IMAGE) $(OGR_IMAGE) | ||
|
||
check: | ||
PYTHONPATH=$(CURDIR) pytest-3 -v $(TEST_TARGET) | ||
|
||
shell: | ||
sudo podman run --rm -ti -v $(CURDIR):/src:Z -w /src $(OGR_IMAGE) bash | ||
|
||
check-pypi-packaging: | ||
sudo podman run --rm -ti -v $(CURDIR):/src:Z -w /src $(OGR_IMAGE) bash -c '\ | ||
set -x \ | ||
&& rm -f dist/* \ | ||
&& python3 ./setup.py sdist bdist_wheel \ | ||
&& pip3 install dist/*.tar.gz \ | ||
&& pip3 show $(PY_PACKAGE) \ | ||
&& twine check ./dist/* \ | ||
&& python3 -c "import ogr; assert ogr.__version__" \ | ||
&& pip3 show -f $(PY_PACKAGE) | ( grep test && exit 1 || :) \ | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
- name: This is a recipe for how to cook with ogr | ||
hosts: all | ||
tasks: | ||
- name: Install all packages needed to hack on ogr. | ||
dnf: | ||
name: | ||
- python3-pip | ||
- python3-setuptools | ||
- git | ||
- python3-setuptools_scm | ||
- python3-setuptools_scm_git_archive | ||
- python3-wheel # for bdist_wheel | ||
- name: Install latest twine for sake of check command | ||
pip: | ||
name: | ||
- twine # we need newest twine, b/c of the check command | ||
- readme_renderer[md] | ||
state: latest | ||
- name: Install dependencies for git APIs | ||
dnf: | ||
name: | ||
- python3-requests | ||
- python3-pygithub | ||
- python3-libpagure | ||
- python3-gitlab | ||
state: present | ||
- name: stat /src | ||
stat: | ||
path: /src | ||
tags: | ||
- no-cache | ||
register: src_path | ||
- name: Let's make sure /src is present | ||
assert: | ||
that: | ||
- 'src_path.stat.isdir' | ||
# this requires to have sources mounted inside at /src | ||
- name: Install ogr from the current working directory | ||
pip: | ||
name: /src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[metadata] | ||
name = ogr | ||
url = https://github.com/user-cont/ogr | ||
description = One API for multiple git forges. | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
author = Red Hat | ||
author_email = [email protected] | ||
license = MIT | ||
license_file = LICENSE | ||
classifiers = | ||
Development Status :: 4 - Beta | ||
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 | ||
Topic :: Software Development | ||
Topic :: Utilities | ||
keywords = | ||
git | ||
api | ||
github | ||
gitlab | ||
pagure | ||
|
||
|
||
[options] | ||
python_requires = >=3.6 | ||
include_package_data = True | ||
|
||
setup_requires = | ||
setuptools_scm | ||
setuptools_scm_git_archive | ||
|
||
install_requires = | ||
GitPython | ||
PyGithub | ||
libpagure | ||
python-gitlab | ||
|
||
[options.extras_require] | ||
testing = | ||
pytest | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/python3 | ||
|
||
import setuptools | ||
|
||
setuptools.setup(use_scm_version=True, | ||
packages=setuptools.find_packages(exclude=['tests*']), ) |