@@ -859,23 +859,25 @@ def version(c, version):
859859 node_version_file = ROOT_DIR / "package.json"
860860 node_version_matcher = re .compile ('"version": ".*"' )
861861 _replace_version (node_version_file , node_version_matcher , f'"version": "{ version } "' )
862- setup_py_file = ROOT_DIR / "setup.py"
863- _replace_version (setup_py_file , node_version_matcher , f'"version": "{ version } "' )
864-
862+ package_lock = ROOT_DIR / "package-lock.json"
863+ data = json .loads (package_lock .read_text ())
864+ data ["version" ] = version
865+ data ["packages" ]["" ]["version" ] = version
866+ package_lock .write_text (json .dumps (data , indent = 2 ))
867+ py_project_toml = ROOT_DIR / "pyproject.toml"
868+ py_project_toml_matcher = re .compile ('version = ".*"' )
869+ _replace_version (py_project_toml , py_project_toml_matcher , f'version = "{ version } "' , 1 )
865870 dockerfile = ROOT_DIR / "docker" / "Dockerfile.latest_release"
866871 docker_version_matcher = re .compile ("robotframework-browser==.*" )
867872 _replace_version (
868873 dockerfile , docker_version_matcher , f"robotframework-browser=={ version } "
869874 )
870- # workflow_file = root_dir / ".github" / "workflows" / "python-package.yml"
871- # workflow_version_matcher = re.compile("VERSION: .*")
872- # _replace_version(workflow_file, workflow_version_matcher, f"VERSION: {version}")
873875
874876
875- def _replace_version (filepath , matcher , version ):
877+ def _replace_version (filepath , matcher , version , count = 0 ):
876878 content = filepath .open ().read ()
877879 with open (filepath , "w" ) as out :
878- out .write (matcher .sub (version , content ))
880+ out .write (matcher .sub (version , content , count ))
879881
880882
881883@task
0 commit comments