diff --git a/CHANGELOG.md b/CHANGELOG.md index e1fe969..557ba29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,16 +4,28 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [1.43.0] - 2020-02-24 +## [1.44.0] - Unreleased +### Added +### Changed +### Fixed + +## [1.43.0] - 2020-07-14 ### Added - Support for reinstalling the operating system to a device, including changing the operating system. +- `Manager.create_vlan` now includes a description argument +### Changed +- `ResponseError` will now be raised when an API call results in an error +### Fixed +- `Manager.validate_capacity` now considers availability +- `Manager.create_project_ssh_key` will retry when it encounters 404 responses following a successful creation. +- API responses with `{"error":""}` keys were not handled well, and will now be handled just like `{"errors":[""]}` keys. ## [1.42.0] - 2020-02-14 ### Added -- Capturing of available_in to Plan -- Capturing of hardware_reservation, spot_price_max, termination_time, and provisioning_percentage to Device +- Capturing of `available_in` to Plan +- Capturing of `hardware_reservation`, `spot_price_max`, `termination_time`, and `provisioning_percentage` to `Device` - Support for creating project ssh keys -- Support for passing custom_data when creating a device +- Support for passing `custom_data` when creating a device ### Fixed - Black not building for CI and thus failing diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..8e2b7d8 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,69 @@ +# Release Instructions + +These build and release instructions are intended for the maintainers and future maintainers of this project. + +## Preparing a new version + +* a version update in `packet/__init__.py` +* Update CHANGELOG.md with the new release notes +* Add a stub for the next set of Unreleased changes +* Create a PR with these changes +* Merge + +## Tagging and Building + +Pull down the merged changes: + +```bash +git fetch origin +git checkout origin/master +``` + +Tag the commit: + +```bash +git tag -a vAA.BB.CC origin/master -m vAA.BB.CC +``` + +Build the package using `setuptools`: + +```bash +python setup.py sdist bdist_wheel +``` + +## Publishing + +Make sure you have `~/.pypirc` correctly populated, as of today should look something like: + +``` +[distutils] +index-servers = + pypi + testpypi + +[pypi] +username: username-here +password: password-here + +[testpypi] +repository: https://test.pypi.org/legacy/ +username: username-here (not necessarily same as real pypi) +password: password-here (not necessarily same as real pypi) +``` + +Then upload using twine to testpypi first: + +```bash +twine upload -r testpypi dist/* +``` + +If everything looks good, push the tag to GH, and then push to the real +pypi: + +```bash +git push origin --tags vAA.BB.CC +twine upload dist/* +``` + +Congratulations, you published `packet-python`, :raised_hands:! + diff --git a/packet/__init__.py b/packet/__init__.py index 1fba8c6..44891a9 100644 --- a/packet/__init__.py +++ b/packet/__init__.py @@ -3,11 +3,11 @@ """library to interact with the Packet API""" -__version__ = "1.42.0" +__version__ = "1.43.0" __author__ = "Packet Engineers" __author_email__ = "help@packet.net" __license__ = "LGPL v3" -__copyright__ = "Copyright (c) 2019, Packet" +__copyright__ = "Copyright (c) 2020, Packet" from .Device import Device # noqa from .Email import Email # noqa diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 69cde9c..a7fff3d --- a/setup.py +++ b/setup.py @@ -1,54 +1,35 @@ #!/usr/bin/env python # SPDX-License-Identifier: LGPL-3.0-only - -# Notes for the not-an-everyday-python-dev for package distribution on pypi -# -# Build the package using `setuptools`: -# -# python setup.py sdist bdist_wheel -# -# Make sure you have ~/.pypirc correctly populated, as of today should look something like: -# -# [distutils] -# index-servers = -# pypi -# testpypi -# -# [pypi] -# username: username-here -# password: password-here -# -# [testpypi] -# repository: https://test.pypi.org/legacy/ -# username: username-here (not necessarily same as real pypi) -# password: password-here (not necessarily same as real pypi) -# -# Then upload using twine to testpypi first: -# -# twine upload -r testpypi dist/* -# -# If all looks good go ahead and tag the repo, push to GH, and then push to real -# pypi: -# -# twine upload dist/* -# -# Congratulations to me, I've just condensed so many webpages into 30 lines, -# :raised_hands:! +import codecs +import os.path try: from setuptools import setup except ImportError: from ez_setup import use_setuptools - use_setuptools() from setuptools import setup + with open("README.md") as readme, open("CHANGELOG.md") as changelog: long_description = readme.read() + "\n" + changelog.read() +def read(rel_path): + here = os.path.abspath(os.path.dirname(__file__)) + with codecs.open(os.path.join(here, rel_path), 'r') as fp: + return fp.read() + +def get_version(rel_path): + for line in read(rel_path).splitlines(): + if line.startswith('__version__'): + delim = '"' if '"' in line else "'" + return line.split(delim)[1] + else: + raise RuntimeError("Unable to find version string.") + setup( name="packet-python", - version="1.42.0", + version=get_version("packet/__init__.py"), description="Packet API client", long_description=long_description, long_description_content_type="text/markdown",