This repository was archived by the owner on May 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 ``kms_crypto_key_resource_name`` (unlike ``kms_crypto_key_id``).
2929
3030"""
31+
32+
33+ __version__ = '0.1.0'
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
2+ import os
3+ import re
4+ from typing import Sequence
5+
26from setuptools import find_packages , setup
37
48
9+ def get_version (* file_paths : Sequence [str ]) -> str :
10+ filename = os .path .join (os .path .dirname (__file__ ), * file_paths )
11+ version_file = open (filename ).read ()
12+ version_match = re .search (
13+ r"^__version__ = ['\"]([^'\"]*)['\"]" , version_file , re .M )
14+ if version_match :
15+ return version_match .group (1 )
16+ raise RuntimeError ('Unable to find version string.' )
17+
18+
19+ version = get_version ('fd_gcp' , '__init__.py' )
20+
21+
522with open ('README.md' ) as readme_file :
623 readme = readme_file .read ()
724
2441 # like 'coverage' or 'tox'.
2542]
2643
27- # TODO: extract from '__version__' in 'fd_gcp/__init__.py'.
28- packages_version = '0.1.0'
29-
3044# note: the "typing information" of this project's packages is not made available to its users
3145# automatically; it needs to be packaged and distributed. The way to do so is fairly new and
3246# it is specified in PEP 561 - "Distributing and Packaging Type Information".
6377 test_suite = 'tests' ,
6478 tests_require = test_requirements ,
6579 url = 'https://github.com/fyndata/gcp-utils-python' ,
66- version = packages_version ,
80+ version = version ,
6781 zip_safe = False ,
6882)
You can’t perform that action at this time.
0 commit comments