Skip to content

Commit e856629

Browse files
committed
Add lockfile creation to new releases
Signed-off-by: Alan Chin <[email protected]>
1 parent 099095c commit e856629

File tree

4 files changed

+30
-9
lines changed

4 files changed

+30
-9
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
.PHONY: lint-dependencies lint-server black-format prettier-check-ui eslint-check-ui prettier-ui eslint-ui lint-ui lint
1919
.PHONY: dev-link dev-unlink
2020
.PHONY: build-dependencies dev-dependencies yarn-install build-ui package-ui package-ui-dev
21-
.PHONY: build-server install-server-package install-server
21+
.PHONY: build-server buiid-lockfile install-server-package install-server
2222
.PHONY: install install-all install-dev install-examples install-gitlab-dependency check-install watch release
2323
.PHONY: test-dependencies pytest test-server test-ui-unit test-integration test-integration-debug test-ui test
2424
.PHONY: docs-dependencies docs
@@ -61,7 +61,7 @@ help:
6161
## Clean targets
6262

6363
purge:
64-
rm -rf build *.egg-info yarn-error.log
64+
rm -rf build *.egg-info requirements.txt yarn-error.log
6565
rm -rf node_modules lib dist
6666
rm -rf $$(find packages -name node_modules -type d -maxdepth 2)
6767
rm -rf $$(find packages -name dist -type d)
@@ -173,6 +173,9 @@ package-ui-dev: dev-dependencies yarn-install dev-link lint-ui build-ui
173173
build-server: # Build backend
174174
$(PYTHON) -m build
175175

176+
build-lockfile: # Build requirements.txt
177+
pip-compile --generate-hashes pyproject.toml
178+
176179
uninstall-server-package:
177180
@$(PYTHON_PIP) uninstall elyra -y
178181

@@ -206,7 +209,6 @@ watch: ## Watch packages. For use alongside jupyter lab --watch
206209

207210
release: yarn-install build-ui build-server ## Build wheel file for release
208211

209-
210212
elyra-image-env: ## Creates a conda env consisting of the dependencies used in images
211213
conda env remove -y -n $(ELYRA_IMAGE_ENV)
212214
conda create -y -n $(ELYRA_IMAGE_ENV) python=$(PYTHON_VERSION) --channel conda-forge

build_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
jupyterlab>=3.4.6,<4.0
2-
jupyter-packaging>=0.10
32
build
3+
pip-tools

create-release.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ def validate_dependencies() -> None:
9292
raise DependencyException("Please install yarn https://classic.yarnpkg.com/")
9393
if not dependency_exists("twine"):
9494
raise DependencyException("Please install twine https://twine.readthedocs.io/en/latest/#installation")
95+
if not dependency_exists("pip-compile"):
96+
raise DependencyException("Please install pip-tools https://pypi.org/project/pip-tools/")
9597

9698

9799
def validate_environment() -> None:
@@ -102,6 +104,8 @@ def validate_environment() -> None:
102104
def update_version_to_release() -> None:
103105
global config
104106

107+
print(f"Updating documentation to Release v{config.new_version}")
108+
105109
old_version = config.old_version
106110
old_npm_version = config.old_npm_version
107111
new_version = config.new_version
@@ -258,6 +262,8 @@ def update_version_to_release() -> None:
258262
)
259263
check_run(["yarn", "version", "--new-version", new_npm_version, "--no-git-tag-version"], cwd=config.source_dir)
260264

265+
print(f"Finished updating documentation to Release v{config.new_version}")
266+
261267
except Exception as ex:
262268
raise UpdateVersionException from ex
263269

@@ -500,6 +506,14 @@ def build_server():
500506
print("")
501507

502508

509+
def create_requirements_lockfile():
510+
print("-----------------------------------------------------------------")
511+
print("--------------------- Creating Lockfile -------------------------")
512+
print("-----------------------------------------------------------------")
513+
check_run(["pip-compile", "--generate-hashes", "pyproject.toml"], cwd=config.source_dir, capture_output=False)
514+
check_run(["git", "add", "requirements.txt"], cwd=config.source_dir, capture_output=False)
515+
516+
503517
def show_release_artifacts():
504518
global config
505519
dist_dir = os.path.join(config.source_dir, "dist")
@@ -734,7 +748,7 @@ def prepare_changelog() -> None:
734748
generate_changelog()
735749
# commit
736750
check_run(
737-
["git", "commit", "-a", "-m", f"Update changelog for release {config.new_version}"], cwd=config.source_dir
751+
["git", "commit", "-a", "-s", "-m", f"Update changelog for release {config.new_version}"], cwd=config.source_dir
738752
)
739753

740754

@@ -750,11 +764,16 @@ def prepare_release() -> None:
750764
checkout_code()
751765
# generate changelog with new release list of commits
752766
prepare_changelog()
767+
# create requirements lock file
768+
create_requirements_lockfile()
753769
# Update to new release version
754770
update_version_to_release()
755771
# commit and tag
756-
check_run(["git", "commit", "-a", "-m", f"Release v{config.new_version}"], cwd=config.source_dir)
757-
check_run(["git", "tag", config.tag], cwd=config.source_dir)
772+
print(f"Committing changes for release v{config.new_version}")
773+
check_run(["git", "commit", "-a", "-s", "-m", f"Release v{config.new_version}"], cwd=config.source_dir)
774+
# Ensure you have tags.gpgSign set to True and user.signingkey configured via git config
775+
print(f"Creating tag for release v{config.new_version}")
776+
check_run(["git", "tag", config.tag, "-m", f"Release v{config.new_version}"], cwd=config.source_dir)
758777
# server-only wheel
759778
build_server()
760779
# build release wheel and npm artifacts
@@ -764,7 +783,7 @@ def prepare_release() -> None:
764783
# back to development
765784
update_version_to_dev()
766785
# commit
767-
check_run(["git", "commit", "-a", "-m", f"Prepare for next development iteration"], cwd=config.source_dir)
786+
check_run(["git", "commit", "-a", "-s", "-m", f"Prepare for next development iteration"], cwd=config.source_dir)
768787
# prepare extensions
769788
prepare_extensions_release()
770789
# prepare runtime extsnsions

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ maintainers = [
1313
readme = "README.md"
1414
requires-python = ">=3.7"
1515
dependencies = [
16-
"autopep8>=1.5.0",
16+
"autopep8>=1.5.0,<1.7.0", # Cap from python-lsp-server
1717
"click>=8", # elyra-ai/elyra#2579
1818
"colorama",
1919
"deprecation",

0 commit comments

Comments
 (0)