Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions _tools/protogen_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,3 @@ find "${out_dir}" -name '*.py' -exec sed -i -e 's/^from github/from bblfsh.githu
find "${out_dir}" -name '*.py' -exec sed -i -e "s/import_module('gopkg.in/import_module('bblfsh.gopkg.in/g" {} \;
# on macOS sed -i -e produces backups with *-e extension by default
find "${out_dir}" -name '*.py-e' -delete

# make a python packages
<< END >> "${out_dir}/lookout/__init__.py"
# DO NOT CHANGE OR ADD ANYTHING HERE
import pkg_resources
pkg_resources.declare_namespace(__name__)
__version__ = 0, 0, 1
END
touch "${out_dir}/lookout/sdk/__init__.py"
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ make toc
## Release Process

1. Make sure all the [auto-generated code](#generated-code) is up to date and committed.
1. Update `VERSION` in `python/setup.py` with the same version that you will use for the tag (manual step required until [#2](https://github.com/src-d/lookout-sdk/issues/2) is implemented).
1. Update `__version__` in `python/lookout/sdk/__init__.py` with the same version that you will use for the tag (manual step required until [#2](https://github.com/src-d/lookout-sdk/issues/2) is implemented).
1. Create the release tag.
1 change: 1 addition & 0 deletions python/lookout/sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.2.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is more common to specify this as a tuple:

__version__ = 0, 2, 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL you are right https://www.python.org/dev/peps/pep-0396
A good example of poor design... I have to live with it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference, another example of string version can be found in the docs here: https://packaging.python.org/tutorials/packaging-projects/#creating-setup-py

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! The PEP is from 2011! But I have never heard of it!

45 changes: 25 additions & 20 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
import io
import os
import re
from setuptools import setup, find_packages

VERSION = "0.2.0"
README = "../README.md"

description = "SDK for writing lookout analyzers"
here = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(here, README), encoding="utf-8") as f:
with open(os.path.join(here, README), encoding="utf-8") as f:
long_description = "\n" + f.read()

# Get the version (borrowed from SQLAlchemy)
with open(os.path.join(here, "lookout", "sdk", "__init__.py")) as fp:
VERSION = re.compile(r".*__version__ = \"(.*?)\"",
re.S).match(fp.read()).group(1)

setup(
name="lookout-sdk",
version=VERSION,
description=description,
license="Apache 2.0",
author="source{d}",
long_description=long_description,
long_description_content_type="text/markdown",
author_email="[email protected]",
url="https://github.com/src-d/lookout-sdk",
download_url="https://github.com/src-d/lookout-sdk",
packages=find_packages(),
namespace_packages=["lookout"],
keywords=["analyzer", "code-reivew"],
install_requires=["grpcio==1.13.0", "protobuf>=3.5.0,<4.0", "bblfsh>=2.12.0,<3.0"],
package_data={"": ["../LICENSE.md", "../MAINTAINERS", README]},
classifiers=[
name="lookout-sdk",
version=VERSION,
description=description,
license="Apache 2.0",
author="source{d}",
long_description=long_description,
long_description_content_type="text/markdown",
author_email="[email protected]",
url="https://github.com/src-d/lookout-sdk",
download_url="https://github.com/src-d/lookout-sdk",
packages=find_packages(),
namespace_packages=["lookout"],
keywords=["analyzer", "code-reivew"],
install_requires=["grpcio==1.13.0",
"protobuf>=3.5.0,<4.0", "bblfsh>=2.12.0,<3.0"],
package_data={"": ["../LICENSE.md", "../MAINTAINERS", README]},
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
Expand All @@ -37,5 +42,5 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries"
],
],
)