diff --git a/docs/developer/setup.rst b/docs/developer/setup.rst index da542435f..1843b5734 100644 --- a/docs/developer/setup.rst +++ b/docs/developer/setup.rst @@ -83,6 +83,14 @@ pull`` just run :git_url:`setup_within_klayout.py` again. This will take care of KQCircuit's Python dependencies and installing new ones, as needed. Running KLayout will similarly update KQCircuits' dependencies in its own Python environment. +If the above didn't work (usually in case of downgrading dependencies), there is an alternative way. +If you see warnings displaying +``WARNING: Target directory xyz already exists. Specify --upgrade to force replacement.``, +this usually indicates that KQCircuits's Python dependencies were not properly upgraded (or downgraded). +In that case run the following: + + python3 setup_within_klayout.py --force-package-reinstall + .. note:: If a new version of KQCircuits has stopped using a certain Python dependency that will **not** be removed automatically. The user has to remove that manually if it causes any problem. diff --git a/docs/user_guide/xsection.rst b/docs/user_guide/xsection.rst index 44727f4f9..988afe303 100644 --- a/docs/user_guide/xsection.rst +++ b/docs/user_guide/xsection.rst @@ -36,6 +36,13 @@ generation for simulation files. An example of using XSection tool to produce cross-section simulation files is demonstrated in :git_url:`klayout_package/python/scripts/simulations/waveguides_sim_xsection.py` +.. note:: + XSection 1.7 does not work immediately after package install due to the improvement + to backwards compatibility with older Ruby versions. To mitigate the issue, + you need to make a change in the XSection code. From you KLayout environment directory, + open ``KLayout/salt/xsetion/ruby/xsection.rb`` file in editor and change line 200 + from ``pts << [[[ p1, p2 ]]]`` to ``pts << [[ p1, p2 ]]`` + Process files (.xs) ------------------- diff --git a/klayout_package/python/setup.py b/klayout_package/python/setup.py index 645dd0b30..94979517e 100644 --- a/klayout_package/python/setup.py +++ b/klayout_package/python/setup.py @@ -53,11 +53,11 @@ def get_version_and_cmdclass(package_name): # in elmer_export.py and gmsh_helpers.py, consider adding if more features are needed. ], extras_require={ - "docs": ["sphinx~=4.4", "sphinx-rtd-theme~=0.4", "networkx>=2.7", "matplotlib>=3.5.1"], + "docs": ["sphinx~=4.4", "sphinx-rtd-theme~=0.4", "networkx>=2.7,<3.2", "matplotlib>=3.5.1"], "tests": ["pytest>=6.0.2", "pytest-cov~=2.8", "pytest-xdist>=2.1", "tox>=3.18", "pylint==2.9", - "networkx>=2.7", "matplotlib>=3.5.1"], + "networkx>=2.7,<3.2", "matplotlib>=3.5.1"], "notebooks": ["jupyter~=1.0.0", "klayout>=0.28"], - "graphs": ["networkx>=3.0", "matplotlib>=3.6.3"], + "graphs": ["networkx>=3.0,<3.2", "matplotlib>=3.6.3"], "simulations": ["gmsh>=4.11.1", "pandas>=1.5.3"], }, entry_points={ diff --git a/requirements_within_klayout_unix.txt b/requirements_within_klayout_unix.txt index 67ae5a06c..e28655af0 100644 --- a/requirements_within_klayout_unix.txt +++ b/requirements_within_klayout_unix.txt @@ -4,4 +4,4 @@ numpy>=1.16 scipy>=1.2 Autologging==1.3.2 tqdm==4.61 -networkx>=2.7 +networkx>=2.7,<3.2 diff --git a/requirements_within_klayout_windows.txt b/requirements_within_klayout_windows.txt index c78477079..11c1a9159 100644 --- a/requirements_within_klayout_windows.txt +++ b/requirements_within_klayout_windows.txt @@ -7,4 +7,4 @@ Autologging==1.3.2 tqdm==4.61 -networkx>=2.7 \ No newline at end of file +networkx>=2.7,<3.2 \ No newline at end of file diff --git a/setup_within_klayout.py b/setup_within_klayout.py index 0f1536c34..4bc024e7f 100644 --- a/setup_within_klayout.py +++ b/setup_within_klayout.py @@ -57,6 +57,8 @@ def get_klayout_packages_path(path_start): parser = argparse.ArgumentParser(description='KQC setup within klayout') parser.add_argument('--unlink', action="store_true", help='remove links') + parser.add_argument('--force-package-reinstall', action="store_true", + help='force reinstalling packages that KQCircuits depends on') args = parser.parse_args() configdir = klayout_configdir(kqc_root_path) @@ -89,6 +91,8 @@ def get_klayout_packages_path(path_start): else: raise SystemError("Unsupported operating system.") + if args.force_package_reinstall: + pip_args += " --upgrade" print(f'Required packages will be installed in "{target_dir}".') os.system(f"pip install -r {pip_args}") print("Finished setting up KQC.")