-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweaks to the README, setup.py, etc, for release. (#305)
* Tweaks to the README, setup.py, etc, for release.
- Loading branch information
Showing
5 changed files
with
84 additions
and
28 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
PyYAML | ||
-e . # i.e. get them from setup.py |
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 |
---|---|---|
|
@@ -12,28 +12,60 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from setuptools import setup | ||
import ast | ||
from setuptools import setup, find_packages | ||
|
||
|
||
def _read_me() -> str: | ||
with open("README.md", "rt", encoding="utf8") as fh: | ||
readme = fh.read() | ||
return readme | ||
|
||
|
||
def _get_version() -> str: | ||
# ops.__init__ needs to pull in ops.charm to work around a circular | ||
# import so we can't import it here as that pulls in yaml which isn't | ||
# necessarily there yet. | ||
version = 'unknown' | ||
with open("ops/__init__.py", "rt", encoding="utf8") as fh: | ||
source = fh.read() | ||
code = ast.parse(source) | ||
for node in code.body: | ||
if isinstance(node, ast.Assign): | ||
targets = [i.id for i in node.targets] | ||
if '__version__' in targets: | ||
if isinstance(node.value, ast.Str): | ||
# Python < 3.8 | ||
version = node.value.s | ||
else: | ||
version = node.value.value | ||
break | ||
return version | ||
|
||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
setup( | ||
name="ops", | ||
version="0.0.1", | ||
version=_get_version(), | ||
description="The Python library behind great charms", | ||
long_description=long_description, | ||
long_description=_read_me(), | ||
long_description_content_type="text/markdown", | ||
license="Apache-2.0", | ||
url="https://github.com/canonical/operator", | ||
packages=["ops"], | ||
author="The Charmcraft team at Canonical Ltd.", | ||
author_email="[email protected]", | ||
packages=find_packages(include=('ops', 'ops.*')), | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
|
||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
|
||
"License :: OSI Approved :: Apache Software License", | ||
"Development Status :: 4 - Beta", | ||
|
||
"Intended Audience :: Developers", | ||
"Intended Audience :: System Administrators", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Operating System :: POSIX :: Linux", | ||
# include Windows once we're running tests there also | ||
# "Operating System :: Microsoft :: Windows", | ||
], | ||
python_requires='>=3.5', | ||
install_requires=["PyYAML"], | ||
) |
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