From 933b483c4afe35c92604d985a05c9999852a2abb Mon Sep 17 00:00:00 2001 From: Matt Reimer Date: Fri, 12 Jan 2024 12:42:51 -0800 Subject: [PATCH] adding codespace config --- .devcontainer/Dockerfile | 17 ++++ .devcontainer/devcontainer.json | 61 ++++++++++++++ .devcontainer/requirements.docker.txt | 16 ++++ .vscode/.ropeproject/config.py | 114 -------------------------- .vscode/.ropeproject/objectdb | Bin 6 -> 0 bytes .vscode/settings.json | 1 - RSXML-RiverscapesXML.code-workspace | 94 ++++++++++----------- RiverscapesXML.code-workspace | 62 ++++++++------ 8 files changed, 176 insertions(+), 189 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/requirements.docker.txt delete mode 100644 .vscode/.ropeproject/config.py delete mode 100644 .vscode/.ropeproject/objectdb delete mode 100644 .vscode/settings.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..27627d6a --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,17 @@ +############################################################################################ +# Dev Container for riverscapes-tools +############################################################################################ +FROM mcr.microsoft.com/devcontainers/python:3.11 AS worker + +# Some preliminary dependencies +RUN apt update && apt upgrade -y && apt autoremove -y + +# Now install any lingering dependencies +COPY requirements.docker.txt /workspaces/requirements.txt +RUN pip --timeout=120 install -r /workspaces/requirements.txt + +# Now install user preferences +USER vscode +RUN wget https://raw.githubusercontent.com/Riverscapes/environment/master/nar-ys.zsh-theme -O ~/.oh-my-zsh/custom/themes/nar-ys.zsh-theme +RUN wget https://raw.githubusercontent.com/Riverscapes/environment/master/.aliases -O ~/.aliases +RUN wget https://raw.githubusercontent.com/Riverscapes/environment/master/.zshrc -O ~/.zshrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..a1b6dd73 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,61 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Riverscapes XML", + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.defaultProfile.linux": "zsh", + "[python]": { + "editor.tabSize": 4, + "editor.formatOnSave": true + }, + "python.analysis.extraPaths": ["../../lib/commons"], + "pylint.args": [ + "--extension-pkg-whitelist=pygeoprocessing", + "--ignore=E501", + "--max-line-length=240" + ], + "python.terminal.activateEnvironment": true, + "python.testing.pytestEnabled": true, + "python.testing.unittestEnabled": true, + "files.watcherExclude": { + "**/*.egg-info/**": true, + "**/docs/**": true, + "**/*.pytest_cache/**": true, + "**/.venv/**": true, + "**/__pycache__/**": true + }, + "search.exclude": { + "**/*.egg-info/**": true, + "**/*.pytest_cache/**": true, + "**/.venv/**": true, + "**/__pycache__/**": true + }, + "files.exclude": { + "**/*.egg-info/**": true, + "**/*.pytest_cache/**": true, + "**/.venv/**": true, + "**/__pycache__/**": true + } + }, + // Suggested extensions that will be installed for everyone + "extensions": [ + "mhutchie.git-graph", + "ms-python.autopep8", + "ms-python.pylint", + "ms-python.python", + "ms-python.vscode-pylance", + "njpwerner.autodocstring", + "redhat.vscode-xml", + "unifiedjs.vscode-mdx", + "yzhang.markdown-all-in-one", + "GitHub.copilot-chat", + "GitHub.copilot" + ] + } + } +} \ No newline at end of file diff --git a/.devcontainer/requirements.docker.txt b/.devcontainer/requirements.docker.txt new file mode 100644 index 00000000..8938887b --- /dev/null +++ b/.devcontainer/requirements.docker.txt @@ -0,0 +1,16 @@ +autopep8==1.7.0 +charset-normalizer==3.1.0 +exceptiongroup==1.1.1 +jsonschema==4.15.0 +lxml==4.9.2 +packaging==23.1 +pluggy==1.0.0 +pycodestyle==2.10.0 +pylint==2.15.0 +pytest==7.2.0 +requests==2.31.0 +semver==3.0.0 +termcolor==2.3.0 +toml==0.10.2 +tomli==2.0.1 +urllib3==2.0.2 diff --git a/.vscode/.ropeproject/config.py b/.vscode/.ropeproject/config.py deleted file mode 100644 index ac2cfb35..00000000 --- a/.vscode/.ropeproject/config.py +++ /dev/null @@ -1,114 +0,0 @@ -# The default ``config.py`` -# flake8: noqa - - -def set_prefs(prefs): - """This function is called before opening the project""" - - # Specify which files and folders to ignore in the project. - # Changes to ignored resources are not added to the history and - # VCSs. Also they are not returned in `Project.get_files()`. - # Note that ``?`` and ``*`` match all characters but slashes. - # '*.pyc': matches 'test.pyc' and 'pkg/test.pyc' - # 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc' - # '.svn': matches 'pkg/.svn' and all of its children - # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o' - # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o' - prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject', - '.hg', '.svn', '_svn', '.git', '.tox'] - - # Specifies which files should be considered python files. It is - # useful when you have scripts inside your project. Only files - # ending with ``.py`` are considered to be python files by - # default. - # prefs['python_files'] = ['*.py'] - - # Custom source folders: By default rope searches the project - # for finding source folders (folders that should be searched - # for finding modules). You can add paths to that list. Note - # that rope guesses project source folders correctly most of the - # time; use this if you have any problems. - # The folders should be relative to project root and use '/' for - # separating folders regardless of the platform rope is running on. - # 'rsxml/my_source_folder' for instance. - # prefs.add('source_folders', 'rsxml') - - # You can extend python path for looking up modules - # prefs.add('python_path', '~/python/') - - # Should rope save object information or not. - prefs['save_objectdb'] = True - prefs['compress_objectdb'] = False - - # If `True`, rope analyzes each module when it is being saved. - prefs['automatic_soa'] = True - # The depth of calls to follow in static object analysis - prefs['soa_followed_calls'] = 0 - - # If `False` when running modules or unit tests "dynamic object - # analysis" is turned off. This makes them much faster. - prefs['perform_doa'] = True - - # Rope can check the validity of its object DB when running. - prefs['validate_objectdb'] = True - - # How many undos to hold? - prefs['max_history_items'] = 32 - - # Shows whether to save history across sessions. - prefs['save_history'] = True - prefs['compress_history'] = False - - # Set the number spaces used for indenting. According to - # :PEP:`8`, it is best to use 4 spaces. Since most of rope's - # unit-tests use 4 spaces it is more reliable, too. - prefs['indent_size'] = 4 - - # Builtin and c-extension modules that are allowed to be imported - # and inspected by rope. - prefs['extension_modules'] = [] - - # Add all standard c-extensions to extension_modules list. - prefs['import_dynload_stdmods'] = True - - # If `True` modules with syntax errors are considered to be empty. - # The default value is `False`; When `False` syntax errors raise - # `rope.base.exceptions.ModuleSyntaxError` exception. - prefs['ignore_syntax_errors'] = False - - # If `True`, rope ignores unresolvable imports. Otherwise, they - # appear in the importing namespace. - prefs['ignore_bad_imports'] = False - - # If `True`, rope will insert new module imports as - # `from import ` by default. - prefs['prefer_module_from_imports'] = False - - # If `True`, rope will transform a comma list of imports into - # multiple separate import statements when organizing - # imports. - prefs['split_imports'] = False - - # If `True`, rope will remove all top-level import statements and - # reinsert them at the top of the module when making changes. - prefs['pull_imports_to_top'] = True - - # If `True`, rope will sort imports alphabetically by module name instead - # of alphabetically by import statement, with from imports after normal - # imports. - prefs['sort_imports_alphabetically'] = False - - # Location of implementation of - # rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general - # case, you don't have to change this value, unless you're an rope expert. - # Change this value to inject you own implementations of interfaces - # listed in module rope.base.oi.type_hinting.providers.interfaces - # For example, you can add you own providers for Django Models, or disable - # the search type-hinting in a class hierarchy, etc. - prefs['type_hinting_factory'] = ( - 'rope.base.oi.type_hinting.factory.default_type_hinting_factory') - - -def project_opened(project): - """This function is called after opening the project""" - # Do whatever you like here! diff --git a/.vscode/.ropeproject/objectdb b/.vscode/.ropeproject/objectdb deleted file mode 100644 index 0a47446c0ad231c193bdd44ff327ba2ab28bf3d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6 NcmZo*sx4&D0{{kv0iOT> diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 9e26dfee..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/RSXML-RiverscapesXML.code-workspace b/RSXML-RiverscapesXML.code-workspace index 2596003a..ad6d6bfb 100644 --- a/RSXML-RiverscapesXML.code-workspace +++ b/RSXML-RiverscapesXML.code-workspace @@ -1,66 +1,62 @@ { - "folders": [ - { + "folders": [ + { "name": "📦 rsxml", - "path": "python/packages/rsxml" - }, - { + "path": "python/packages/rsxml" + }, + { "name": "🏠 Home", - "path": "." - } - ], - "settings": { + "path": "." + } + ], + "settings": { + "terminal.integrated.defaultProfile.linux": "zsh", "[python]": { "editor.tabSize": 4, - "editor.formatOnSave": true, - "editor.defaultFormatter": "ms-python.autopep8", + "editor.formatOnSave": true }, - // "python.analysis.typeCheckingMode": "basic", - "python.linting.ignorePatterns": [ - "**/site-packages/**/*.py", - ".vscode/*.py" - ], - "python.linting.pylintArgs": [ - "--extension-pkg-whitelist=sqlite3,math,lxml", - "--ignore=E501", - "--max-line-length=240" - ], - "python.linting.enabled": true, - "python.linting.lintOnSave": true, - "python.linting.pycodestyleEnabled": true, - "python.linting.pylintEnabled": true, - "python.linting.pycodestyleArgs": [ - "--ignore=E501", - "--max-line-length=240" - ], - "python.formatting.autopep8Args": [ + "pylint.args": [ + "--extension-pkg-whitelist=pygeoprocessing", "--ignore=E501", "--max-line-length=240" ], - "python.terminal.activateEnvInCurrentTerminal": true, "python.terminal.activateEnvironment": true, - "python.testing.pytestEnabled": false, + "python.testing.pytestEnabled": true, "python.testing.unittestEnabled": true, - "python.testing.autoTestDiscoverOnSaveEnabled": true, - "files.exclude": { - "**/*.egg-info": true, - "**/.pytest_cache/**": true, - "**/python/**": true, - "**/.venv/**": true - }, "files.watcherExclude": { "**/*.egg-info/**": true, - "**/.pytest_cache/**": true, - "**/dist/**": true, - "**/build/**": true, - "**/python/**": true, - "**/.venv/**": true + "**/docs/**": true, + "**/*.pytest_cache/**": true, + "**/.venv/**": true, + "**/__pycache__/**": true }, "search.exclude": { - "**/*.egg-info": true, - "**/.pytest_cache/**": true, - "**/python/**": true, - "**/.venv/**": true + "**/*.egg-info/**": true, + "**/*.pytest_cache/**": true, + "**/.venv/**": true, + "**/__pycache__/**": true }, - } + "files.exclude": { + "**/*.egg-info/**": true, + "**/*.pytest_cache/**": true, + "**/.venv/**": true, + "**/__pycache__/**": true + } + }, + // Suggested extensions that will be installed for everyone + "extensions": { + "recommendations": [ + "mhutchie.git-graph", + "ms-python.autopep8", + "ms-python.pylint", + "ms-python.python", + "ms-python.vscode-pylance", + "njpwerner.autodocstring", + "redhat.vscode-xml", + "unifiedjs.vscode-mdx", + "yzhang.markdown-all-in-one", + "GitHub.copilot-chat", + "GitHub.copilot" + ] + } } \ No newline at end of file diff --git a/RiverscapesXML.code-workspace b/RiverscapesXML.code-workspace index eff22415..b1d42c6a 100644 --- a/RiverscapesXML.code-workspace +++ b/RiverscapesXML.code-workspace @@ -21,43 +21,55 @@ "path": "." } ], - "settings": { + "settings": { + "terminal.integrated.defaultProfile.linux": "zsh", "[python]": { "editor.tabSize": 4, - "editor.formatOnSave": true, + "editor.formatOnSave": true }, - // "python.analysis.typeCheckingMode": "basic", - "python.linting.ignorePatterns": [ - "**/site-packages/**/*.py", - ".vscode/*.py" - ], - "python.linting.pylintArgs": [ - "--extension-pkg-whitelist=sqlite3", - "--ignore=E501", - "--max-line-length=240" - ], - "python.linting.enabled": true, - "python.linting.lintOnSave": true, - "python.linting.pycodestyleEnabled": true, - "python.linting.pylintEnabled": true, - "python.linting.pycodestyleArgs": [ - "--ignore=E501", - "--max-line-length=240" - ], - "python.formatting.autopep8Args": [ + "python.analysis.extraPaths": ["../../lib/commons"], + "pylint.args": [ + "--extension-pkg-whitelist=pygeoprocessing", "--ignore=E501", - "--max-line-length=240" + "--max-line-length=240" ], - "python.terminal.activateEnvInCurrentTerminal": true, "python.terminal.activateEnvironment": true, "python.testing.pytestEnabled": true, - }, + "python.testing.unittestEnabled": true, + "files.watcherExclude": { + "**/*.egg-info/**": true, + "**/docs/**": true, + "**/*.pytest_cache/**": true, + "**/.venv/**": true, + "**/__pycache__/**": true + }, + "search.exclude": { + "**/*.egg-info/**": true, + "**/*.pytest_cache/**": true, + "**/.venv/**": true, + "**/__pycache__/**": true + }, + "files.exclude": { + "**/*.egg-info/**": true, + "**/*.pytest_cache/**": true, + "**/.venv/**": true, + "**/__pycache__/**": true + } + }, + // Suggested extensions that will be installed for everyone "extensions": { "recommendations": [ + "mhutchie.git-graph", + "ms-python.autopep8", "ms-python.pylint", "ms-python.python", + "ms-python.vscode-pylance", "njpwerner.autodocstring", - "redhat.vscode-xml" + "redhat.vscode-xml", + "unifiedjs.vscode-mdx", + "yzhang.markdown-all-in-one", + "GitHub.copilot-chat", + "GitHub.copilot" ] } } \ No newline at end of file