Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdk/python] Allow editable installs without build step #357

Merged
merged 1 commit into from
Jul 22, 2024
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
3 changes: 2 additions & 1 deletion sdk/python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
.mypy_cache/
*.pyc
/env/
/*.egg-info
*.egg-info/
.venv/
build/
4 changes: 2 additions & 2 deletions sdk/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ ensure::

build::
rm -rf $(PYENVSRC) && cp -R ./lib/. $(PYENVSRC)/
sed -i.bak "s/\$${VERSION}/$(PYPI_VERSION)/g" $(PYENVSRC)/setup.py && rm $(PYENVSRC)/setup.py.bak
sed -i.bak "s/\$${VERSION}/$(VERSION:v%=%)/g" $(PYENVSRCLIB)/version.py && rm $(PYENVSRCLIB)/version.py.bak
sed -i.bak 's/^VERSION = .*/VERSION = "$(PYPI_VERSION)"/g' $(PYENVSRC)/setup.py && rm $(PYENVSRC)/setup.py.bak
sed -i.bak 's/^VERSION = .*/VERSION = "$(VERSION)"/g' $(PYENVSRCLIB)/version.py && rm $(PYENVSRCLIB)/version.py.bak

cp ../../README.md $(PYENVSRC)
cd $(PYENVSRC) && pipenv run python setup.py build bdist_wheel --universal
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/lib/pulumi_policy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

VERSION = "${VERSION}"
VERSION = "1.0.0"
11 changes: 8 additions & 3 deletions sdk/python/lib/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@

from setuptools import setup, find_packages

VERSION = "1.0.0"

def readme():
with open('README.md', encoding='utf-8') as f:
return f.read()
try:
with open('README.md', encoding='utf-8') as f:
return f.read()
except FileNotFoundError:
return "Pulumi's Policy Python SDK - Development Version"

setup(name='pulumi_policy',
version='${VERSION}',
version=VERSION,
description='Pulumi\'s Policy Python SDK',
long_description=readme(),
long_description_content_type='text/markdown',
Expand Down
Loading