sync with master

This commit is contained in:
craigmiller 2023-01-16 07:18:34 -07:00
parent c83d7154c6
commit e0cfb9abd3
6 changed files with 147 additions and 28 deletions

View File

@ -123,14 +123,20 @@
"redhat.vscode-yaml", "redhat.vscode-yaml",
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Markdown // Markdown and reStructured Text
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// - Markdown All in One // - Markdown All in One
"yzhang.markdown-all-in-one", "yzhang.markdown-all-in-one",
// - Markdown PDF // - Markdown PDF
"yzane.markdown-pdf", "yzane.markdown-pdf",
// - markdownlint // - markdownlint
"davidanson.vscode-markdownlint" "davidanson.vscode-markdownlint",
// - Esbonio (conflicts with reStructuredText)
//"swyddfa.esbonio",
// - reStructuredText
"lextudio.restructuredtext",
// - reStructuredText Syntax highlighting
"trond-snekvik.simple-rst",
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CSS // CSS

93
.vscode/launch.json vendored
View File

@ -2,12 +2,103 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Python: Current File", // this will only work with a local python environment
"name": "L-py-file",
"type": "python", "type": "python",
"request": "launch", "request": "launch",
"program": "${file}", "program": "${file}",
"console": "integratedTerminal", "console": "integratedTerminal",
"justMyCode": true "justMyCode": true
},
{
"name": "L-dj-server",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/src/manage.py",
"args": [
"runserver",
],
"django": true
},
{
// launch local FastAPI on default port 8000
// this will not work with a docker container
"name": "L-p8000-api-uvicorn",
"type": "python",
"request": "launch",
"module": "uvicorn",
"cwd": "${workspaceFolder}/src/api/",
"args": [
"startup:app",
"--reload",
"--port",
"8000"
],
"jinja": true,
"justMyCode": false
},
{
//> Set PYDEVD_DISABLE_FILE_VALIDATION=1
//> python -m debugpy --listen 8888 --wait-for-client startup.py
// then select this script and start debug (F5)
// finally, view FastAPI from the browser to hit breakpoints
// http://0.0.0.0:8000
// http://0.0.0.0:8000/docs
// this is the default port 8000
"name": "L-p8888-api-debugpy",
"type": "python",
"request": "attach",
"connect": {
"host": "localhost",
"port": 8888
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}/src/api/",
"remoteRoot": "."
} }
],
"justMyCode": false
},
{
"name": "C-p5678-app-debugpy",
"type": "python",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}/src/app",
"remoteRoot": "."
}
],
"justMyCode": false
},
{
//> Set PYDEVD_DISABLE_FILE_VALIDATION=1
// run the docker container that has this entrypoint that forwards to our local port 9988
// entrypoint: [ "python", "-m", "debugpy", "--listen", "0.0.0.0:$FASTAPI_DOCKER_DEBUG_PORT", "--wait-for-client", "startup.py" ]
// then select this script and start debug (F5)
// finally, view FastAPI from the browser to hit breakpoints
// http://0.0.0.0:8011
// http://0.0.0.0:8011/docs
// FASTAPI_LOCAL_PORT used to forward to container port to the local port 8011
"name": "C-p9988-api-debugpy",
"type": "python",
"request": "attach",
"connect": {
"host": "localhost",
"port": 9988
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}/src/api/",
"remoteRoot": "."
}
],
"justMyCode": false
},
] ]
} }

42
.vscode/settings.json vendored
View File

@ -1,25 +1,37 @@
{ {
"python.pythonPath": "${workspaceFolder}/.env38/Scripts/python.exe",
//
"workbench.colorCustomizations": { "workbench.colorCustomizations": {
"activityBar.activeBackground": "#5d98cd", "activityBar.activeBackground": "#1e535f",
"activityBar.background": "#5d98cd", "activityBar.background": "#1e535f",
"activityBar.foreground": "#15202b", "activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#15202b99", "activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#f0cee0", "activityBarBadge.background": "#300f2a",
"activityBarBadge.foreground": "#15202b", "activityBarBadge.foreground": "#e7e7e7",
"commandCenter.border": "#e7e7e799", "commandCenter.border": "#e7e7e799",
"sash.hoverBorder": "#5d98cd", "sash.hoverBorder": "#1e535f",
"statusBar.background": "#3a7fbd", "statusBar.background": "#123138",
"statusBar.foreground": "#e7e7e7", "statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#5d98cd", "statusBarItem.hoverBackground": "#1e535f",
"statusBarItem.remoteBackground": "#3a7fbd", "statusBarItem.remoteBackground": "#123138",
"statusBarItem.remoteForeground": "#e7e7e7", "statusBarItem.remoteForeground": "#e7e7e7",
"titleBar.activeBackground": "#3a7fbd", "titleBar.activeBackground": "#123138",
"titleBar.activeForeground": "#e7e7e7", "titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#3a7fbd99", "titleBar.inactiveBackground": "#12313899",
"titleBar.inactiveForeground": "#e7e7e799" "titleBar.inactiveForeground": "#e7e7e799"
}, },
"python.testing.unittestArgs": ["-v", "-s", "./tests", "-p", "test_*.py"], //JWL4-BlueGreen
"python.testing.pytestEnabled": false, "peacock.color": "#123138",
//
// reStructuredText, root ReadMe.rst
//"esbonio.sphinx.confDir": "",
//
// test
"python.testing.pytestArgs": [
"src",
"tests",
],
"python.testing.unittestEnabled": true, "python.testing.unittestEnabled": true,
"peacock.color": "#3a7fbd" "python.testing.pytestEnabled": false,
"esbonio.sphinx.confDir": "",
} }

View File

@ -77,7 +77,7 @@ Ready to contribute? Here's how to set up `pipreqs` for local development.
5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:: 5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::
$ flake8 pipreqs tests $ flake8 pipreqs tests
$ python setup.py test > pipreqs_setup_test_result.txt $ python setup.py test
$ tox $ tox
To get flake8 and tox, just pip install them into your virtualenv. (or $pip install -r requirements-dev.txt) To get flake8 and tox, just pip install them into your virtualenv. (or $pip install -r requirements-dev.txt)
@ -85,6 +85,7 @@ Ready to contribute? Here's how to set up `pipreqs` for local development.
You may also need to provide `CA_BUNDLE` as an environment variable or parameter in the `tests/.env.test` file. You may also need to provide `CA_BUNDLE` as an environment variable or parameter in the `tests/.env.test` file.
$ export CA_BUNDLE="/certs/path/certificates.pem" # for nix OS $ export CA_BUNDLE="/certs/path/certificates.pem" # for nix OS
$ set CA_BUNDLE="C:/certs/path/certificates.pem" # for win OS $ set CA_BUNDLE="C:/certs/path/certificates.pem" # for win OS
6. Commit your changes and push your branch to GitHub:: 6. Commit your changes and push your branch to GitHub::

View File

@ -17,6 +17,9 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# fix_SSLError tests.settings (optional) use of .env file # fix_SSLError tests.settings (optional) use of .env file
# alternative would be to set CA_BUNDLE environment variable # alternative would be to set CA_BUNDLE environment variable
# $ export CA_BUNDLE="/certs/path/certificates.pem" # for nix OS
# $ set CA_BUNDLE="C:/certs/path/certificates.pem" # for win OS
python-dotenv python-dotenv
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -25,8 +28,9 @@ flake8
tox # only needed in the environment from which tox is run tox # only needed in the environment from which tox is run
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# (optional, personal choice) # (optional)
# vscode settings: "python.formatting.provider": "black", # vscode settings: "python.formatting.provider": "black",
#black #black
docutils # reStructured Text support
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -6,6 +6,11 @@ test_pipreqs
---------------------------------- ----------------------------------
Tests for `pipreqs` module. Tests for `pipreqs` module.
Environment variables used to mock arguments
e.g.,
$ set CA_BUNDLE="certificates.pem" # for win OS
$ export CA_BUNDLE="certificates.pem" # for nix OS
""" """
import os import os