-
Notifications
You must be signed in to change notification settings - Fork 98
Enable building Python packages for PyPI distribution #103
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
Merged
+239
−66
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
527ca7a
Add the capability to build Python (PyPI) packages directly.
dralley 4311a8e
cmake: Support building libcreaterepo_c statically
jcfr 1227830
cmake: Include OPENSSL_INCLUDE_DIR to support building against custom…
jcfr 6f77806
cmake: Ensure _createrepo_c is weakly linked against python library i…
jcfr a4eee6b
setup.py: Set BUILD_LIBCREATEREPO_C_SHARED to OFF
jcfr e47a89a
setup.py: Fix egg_info build error updating mapping of package to sou…
jcfr 9280ebe
Build and distribute the binaries, too.
dralley fe5a306
setup.py: Set ENABLE_BASHCOMP option instead of checking for SKBUILD
jcfr 717b965
cmake: Introduce CREATEREPO_C_INSTALL_MANPAGES option
jcfr 399975f
cmake: Introduce CREATEREPO_C_INSTALL_DEVELOPMENT option
jcfr cdf910c
cmake: Introduce BIN_INSTALL_DIR to allow customization of executable…
jcfr 56eb1ca
setup.py: Add entrypoints for each repo_c executable
jcfr 3b67fc3
Add requirements-dev.txt
jcfr 58a4505
setup.py: Support building against Python 2 and Python 3
jcfr e804553
Change conditionals a bit
dralley 8c90040
Add this block back, it's necessary for non-python builds
dralley 9b5b5f2
Bump minimum required cmake to 2.8
dralley bf5b805
Move Python __init__.py into src/python/createrepo_c
dralley 7f1fb86
Fix __init__.py when used in a non-Python package context
dralley 85a8615
Remove complicated logic for handling editable installs
dralley 5d6c5e9
Add code to setup.py to parse version from VERSION.cmake
dralley c018c70
README snippet
dralley 5a87e04
Use splitlines() instead of split()
dralley 0cb6fc4
Python bindings don't support deltarpm; disable it
dralley fe04253
Fix package metadata
dralley 2f71436
Utilize GNUInstallDirs
dralley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,9 +1,20 @@ | ||
| from skbuild import setup | ||
|
|
||
| version = '{major}.{minor}.{patch}' | ||
|
|
||
| with open('VERSION.cmake', 'r+') as version_file: | ||
| version_text = version_file.read() | ||
| # split on lines, remove empty lines | ||
| lines = filter(len, version_text.split('\n')) | ||
| # parse out digit characters from the line, convert to int | ||
| numbers = [int("".join(filter(str.isdigit, line))) for line in lines] | ||
| # build version string | ||
| version = version.format(major=numbers[0], minor=numbers[1], patch=numbers[2]) | ||
|
|
||
| setup( | ||
| name='createrepo_c', | ||
| description='C implementation of createrepo', | ||
| version='0.10.0', | ||
| version=version, | ||
| license='GPLv2', | ||
|
||
| author='RPM Software Management', | ||
| author_email='', | ||
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could potentially be done "better" with regex, but I'm pretty weak with regex, and I think it's valid to assume there won't be numeric characters on each line that aren't part of the actual version number.
But I'm open to suggestions on how to do this better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it would be a pure python package, I would suggest to use python-versioneer
But in the case of
createrepo_c, the project can be built either as a standalone project or python package, the version management needs to be available to both.For now, I suggest to stick with your approach. Later after we standardize approaches like the one done here, this could be revisited.