nrd 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nrd-0.0.3/LICENSE +24 -0
- nrd-0.0.3/PKG-INFO +19 -0
- nrd-0.0.3/README.md +4 -0
- nrd-0.0.3/pyproject.toml +25 -0
- nrd-0.0.3/requirements.txt +1 -0
- nrd-0.0.3/src/nrd.py +17 -0
- nrd-0.0.3/src/sites.py +13 -0
- nrd-0.0.3/upload.sh +51 -0
nrd-0.0.3/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
For more information, please refer to <https://unlicense.org>
|
nrd-0.0.3/PKG-INFO
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nrd
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: run vite dev server in background
|
|
5
|
+
Project-URL: Homepage, https://github.com/blemli/nrd2
|
|
6
|
+
Project-URL: Issues, https://github.com/blemli/nrd2
|
|
7
|
+
Author-email: Problemli GmbH <info@problem.li>
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Requires-Dist: icecream>=2.1.3
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# nrd
|
|
17
|
+
|
|
18
|
+
run `npm run dev` in background for all your laravel herd sites
|
|
19
|
+
|
nrd-0.0.3/README.md
ADDED
nrd-0.0.3/pyproject.toml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "nrd"
|
|
3
|
+
version = "0.0.3"
|
|
4
|
+
authors = [
|
|
5
|
+
{ name="Problemli GmbH", email="info@problem.li" },
|
|
6
|
+
]
|
|
7
|
+
description = "run vite dev server in background"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.8"
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Programming Language :: Python :: 3",
|
|
12
|
+
"License :: OSI Approved :: MIT License",
|
|
13
|
+
"Operating System :: OS Independent",
|
|
14
|
+
]
|
|
15
|
+
# Define project dependencies here
|
|
16
|
+
dependencies = [
|
|
17
|
+
"icecream>=2.1.3"
|
|
18
|
+
]
|
|
19
|
+
[project.urls]
|
|
20
|
+
Homepage = "https://github.com/blemli/nrd2"
|
|
21
|
+
Issues = "https://github.com/blemli/nrd2"
|
|
22
|
+
|
|
23
|
+
[build-system]
|
|
24
|
+
requires = ["hatchling"]
|
|
25
|
+
build-backend = "hatchling.build"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
icecream==2.1.8
|
nrd-0.0.3/src/nrd.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
from sites import secured_sites
|
|
4
|
+
import subprocess
|
|
5
|
+
from icecream import ic
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
for site in secured_sites:
|
|
9
|
+
ic(site["site"])
|
|
10
|
+
proc=subprocess.Popen(
|
|
11
|
+
['npm', 'run', 'dev'],
|
|
12
|
+
cwd=site["path"],
|
|
13
|
+
stdout=subprocess.PIPE,
|
|
14
|
+
stderr=subprocess.PIPE,
|
|
15
|
+
text=True,
|
|
16
|
+
)
|
|
17
|
+
proc.communicate()
|
nrd-0.0.3/src/sites.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
import subprocess
|
|
4
|
+
import json
|
|
5
|
+
from icecream import ic
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
output=subprocess.check_output(["herd","parked","--json"])
|
|
9
|
+
sites=json.loads(output)
|
|
10
|
+
secured_sites = [
|
|
11
|
+
site for site in sites
|
|
12
|
+
if site.get("secured") == " X"
|
|
13
|
+
]
|
nrd-0.0.3/upload.sh
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
exists() {
|
|
2
|
+
if command -v "$1" >/dev/null 2>&1; then
|
|
3
|
+
echo "$1 is installed."
|
|
4
|
+
return 0
|
|
5
|
+
else
|
|
6
|
+
echo "$1 is not installed."
|
|
7
|
+
return 1
|
|
8
|
+
fi
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
project_name=$(awk -F '"' '/^name *=/ {print $2}' pyproject.toml)
|
|
12
|
+
echo "building $project_name"
|
|
13
|
+
echo "getting PyPI API Token: "
|
|
14
|
+
if ( exists op ); then
|
|
15
|
+
api_token=$(op item get "pypi api key" --field "Anmeldedaten" --reveal)
|
|
16
|
+
# shellcheck disable=SC2181
|
|
17
|
+
if [ $? -eq 0 ]; then
|
|
18
|
+
echo "API token retrieved successfully."
|
|
19
|
+
else
|
|
20
|
+
api_token=$(read -s -p "Enter your PyPI API token: ")
|
|
21
|
+
fi
|
|
22
|
+
else
|
|
23
|
+
api_token=$(read -s -p "Enter your PyPI API token: ")
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
uv venv
|
|
28
|
+
source .venv/bin/activate
|
|
29
|
+
python3 -m ensurepip --upgrade
|
|
30
|
+
uv pip install --upgrade pip
|
|
31
|
+
uv pip install --upgrade twine
|
|
32
|
+
uv pip install --upgrade build
|
|
33
|
+
|
|
34
|
+
current_version=$(grep "version = " pyproject.toml | sed 's/version = //g' | sed 's/"//g' | sed 's/ //g')
|
|
35
|
+
echo "Current version: $current_version"
|
|
36
|
+
bumped_version=$(python3 -c "print('$current_version'.split('.')[0] + '.' + '$current_version'.split('.')[1] + '.' + str(int('$current_version'.split('.')[2]) + 1))")
|
|
37
|
+
echo "Bumped version: $bumped_version"
|
|
38
|
+
|
|
39
|
+
read -p "Do you want to upload the new version $bumped_version to PyPI? (y/n) " -n 1 -r confirmation
|
|
40
|
+
if [ "$confirmation" == "y" ]; then
|
|
41
|
+
sed -i '' "s/version = \"$current_version\"/version = \"$bumped_version\"/g" pyproject.toml
|
|
42
|
+
rm -rf dist/*
|
|
43
|
+
python3 -m build
|
|
44
|
+
echo "Uploading to PyPI"
|
|
45
|
+
python3 -m twine upload --repository pypi dist/* --user __token__ --password "$api_token"
|
|
46
|
+
pip install --upgrade $project_name
|
|
47
|
+
pip show $project_name
|
|
48
|
+
else
|
|
49
|
+
echo "aborting"
|
|
50
|
+
fi
|
|
51
|
+
|