-
Notifications
You must be signed in to change notification settings - Fork 17
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 #28 from homebysix/pypi
v1.2.0 - Reconfigure docklib repo structure to support publication of releases to PyPI
- Loading branch information
Showing
11 changed files
with
382 additions
and
25 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.DS_Store | ||
*.egg-info | ||
*.pyc | ||
build/ | ||
dist/ | ||
venv/ |
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
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,46 @@ | ||
# Releasing new versions of docklib | ||
|
||
1. Ensure the version in __\_\_init\_\_.py__ has been updated. | ||
|
||
1. Ensure the change log has been updated and reflects actual release date. | ||
|
||
1. Merge development branch to main/master branch. | ||
|
||
1. Run docklib unit tests and fix any errors: | ||
|
||
/usr/local/munki/munki-python -m unittest -v tests/unit.py | ||
|
||
1. Build a new distribution package: | ||
|
||
rm -fv dist/* | ||
python3 setup.py sdist bdist_wheel | ||
|
||
1. Upload package to test.pypi.org: | ||
|
||
twine upload --repository-url https://test.pypi.org/legacy/ dist/* | ||
|
||
1. View resulting project on test.pypi.org and make sure it looks good. | ||
|
||
1. Install test docklib in Munki Python on a test Mac: | ||
|
||
/usr/local/munki/Python.framework/Versions/Current/bin/python3 -m pip install --upgrade -i https://test.pypi.org/simple/ docklib | ||
|
||
1. Perform tests - manual for now. | ||
|
||
1. Upload package to pypi.org: | ||
|
||
twine upload dist/* | ||
|
||
1. View resulting project on pypi.org and make sure it looks good. | ||
|
||
1. Install production docklib in Munki Python on a test Mac: | ||
|
||
/usr/local/munki/Python.framework/Versions/Current/bin/python3 -m pip install --upgrade docklib | ||
|
||
1. Build new installer package using __build_pkg.sh__: | ||
|
||
./build_pkg.sh | ||
|
||
1. Create new release on GitHub. Add notes from change log. Attach built installer package. | ||
|
||
1. Announce to [dock-management](https://macadmins.slack.com/archives/C17NRH534) and other relevant channels, if desired. |
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
#!/bin/bash | ||
|
||
cd "$(dirname "$0")" || exit 1 | ||
|
||
echo "Preparing source folder..." | ||
rm -rfv ./docklib/__pycache__ | ||
rm -fv ./docklib/*.pyc | ||
|
||
echo "Preparing pkgroot and output folders..." | ||
PKGROOT=$(mktemp -d /tmp/docklib-build-root-XXXXXXXXXXX) | ||
OUTPUTDIR=$(mktemp -d /tmp/docklib-output-XXXXXXXXXXX) | ||
mkdir -p "$PKGROOT/Library/Python/2.7/site-packages/" | ||
|
||
echo "Copying docklib into pkgroot..." | ||
# Customize this path if you're not using the macOS built-in Python 2.7 with docklib. | ||
cp -R ./docklib "$PKGROOT/Library/Python/2.7/site-packages/docklib" | ||
|
||
echo "Determining version..." | ||
VERSION=$(awk -F \" '/version/{print $2}' docklib/__init__.py) | ||
echo " Version: $VERSION" | ||
|
||
echo "Building package..." | ||
OUTFILE="$OUTPUTDIR/docklib-$VERSION.pkg" | ||
pkgbuild --root "$PKGROOT" --identifier com.elliotjordan.docklib --version "$VERSION" "$OUTFILE" | ||
echo "$OUTFILE" | ||
open "$OUTPUTDIR" |
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,3 @@ | ||
from .docklib import * | ||
|
||
__version__ = "1.2.0" |
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,51 @@ | ||
"""setup.py for docklib""" | ||
|
||
import pathlib | ||
|
||
from setuptools import setup | ||
|
||
# The directory containing this file | ||
HERE = pathlib.Path(__file__).parent | ||
|
||
# The text of the README file | ||
README = (HERE / "README.md").read_text() | ||
|
||
|
||
def get_version(rel_path): | ||
"""Given a path to a Python init file, return the version string.""" | ||
with open(rel_path, "r") as openfile: | ||
lines = openfile.readlines() | ||
for line in lines: | ||
if line.startswith("__version__"): | ||
delim = '"' if '"' in line else "'" | ||
return line.split(delim)[1] | ||
raise RuntimeError("Unable to find version string.") | ||
|
||
|
||
setup( | ||
name="docklib", | ||
version=get_version("docklib/__init__.py"), | ||
description=( | ||
"Python module intended to assist IT " | ||
"administrators with manipulation of the macOS Dock." | ||
), | ||
long_description=README, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/homebysix/docklib", | ||
author="Elliot Jordan", | ||
author_email="[email protected]", | ||
license="Apache 2.0", | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: MacOS X", | ||
"Intended Audience :: Information Technology", | ||
"Intended Audience :: System Administrators", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: System :: Systems Administration", | ||
"Topic :: Utilities", | ||
], | ||
packages=["docklib"], | ||
include_package_data=True, | ||
) |
Oops, something went wrong.