Skip to content

Commit

Permalink
Include version.py in distribution for certain packages (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzchen authored Aug 2, 2022
1 parent 8200ad0 commit 9880318
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 8 deletions.
3 changes: 3 additions & 0 deletions context/opencensus-context/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Move `version.py` file into `runtime_context` folder
([#1143](https://github.com/census-instrumentation/opencensus-python/pull/1143))

## 0.1.2
Released 2020-06-29

Expand Down
File renamed without changes.
12 changes: 10 additions & 2 deletions context/opencensus-context/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from setuptools import find_packages, setup

from version import __version__
BASE_DIR = os.path.dirname(__file__)
VERSION_FILENAME = os.path.join(
BASE_DIR, "opencensus", "common", "runtime_context", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
exec(f.read(), PACKAGE_INFO)

setup(
name='opencensus-context',
version=__version__, # noqa
version=PACKAGE_INFO["__version__"], # noqa
author='OpenCensus Authors',
author_email='[email protected]',
classifiers=[
Expand Down
3 changes: 3 additions & 0 deletions contrib/opencensus-ext-flask/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Move `version.py` file into `common` folder
([#1143](https://github.com/census-instrumentation/opencensus-python/pull/1143))

## 0.8.0
Released 2022-04-20

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
File renamed without changes.
12 changes: 10 additions & 2 deletions contrib/opencensus-ext-flask/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from setuptools import find_packages, setup

from version import __version__
BASE_DIR = os.path.dirname(__file__)
VERSION_FILENAME = os.path.join(
BASE_DIR, "opencensus", "ext", "flask", "common", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
exec(f.read(), PACKAGE_INFO)

setup(
name='opencensus-ext-flask',
version=__version__, # noqa
version=PACKAGE_INFO["__version__"], # noqa
author='OpenCensus Authors',
author_email='[email protected]',
classifiers=[
Expand Down
2 changes: 2 additions & 0 deletions contrib/opencensus-ext-requests/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Move `version.py` file into `common` folder
([#1143](https://github.com/census-instrumentation/opencensus-python/pull/1143))
- Add `requests` library as a hard dependency
([#1146](https://github.com/census-instrumentation/opencensus-python/pull/1146))

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
File renamed without changes.
12 changes: 10 additions & 2 deletions contrib/opencensus-ext-requests/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from setuptools import find_packages, setup

from version import __version__
BASE_DIR = os.path.dirname(__file__)
VERSION_FILENAME = os.path.join(
BASE_DIR, "opencensus", "ext", "requests", "common", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
exec(f.read(), PACKAGE_INFO)

setup(
name='opencensus-ext-requests',
version=__version__, # noqa
version=PACKAGE_INFO["__version__"], # noqa
author='OpenCensus Authors',
author_email='[email protected]',
classifiers=[
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ deps =
unit,lint,bandit: -e contrib/opencensus-ext-threading
unit,lint,bandit: -e contrib/opencensus-ext-zipkin
unit,lint,bandit: -e contrib/opencensus-ext-google-cloud-clientlibs
lint: flake8
lint: flake8 ~= 4.0.1
lint: isort ~= 4.3.21
setup: docutils
setup: pygments
Expand All @@ -68,4 +68,4 @@ commands =
bandit: bandit -r context/ contrib/ opencensus/ -lll -q
py39-setup: python setup.py check --restructuredtext --strict
py39-docs: bash ./scripts/update_docs.sh
; TODO deployment
; TODO deployment

0 comments on commit 9880318

Please sign in to comment.