Compare commits
20 Commits
v4.0.12
...
6ac1015718
Author | SHA1 | Date | |
---|---|---|---|
6ac1015718 | |||
f20c2b24f0 | |||
113445ca43 | |||
bdb7851064 | |||
cdb30f2dc0 | |||
fb8bfa6a9c | |||
79adf18d9a | |||
7ce71dfca8 | |||
3bcd4f3f6d | |||
d4ef1c70e0 | |||
c9e107d2fd | |||
b6b4f2e5b8 | |||
432593a0f3 | |||
6629caf459 | |||
8bcc99b898 | |||
05694ed022 | |||
67bd712590 | |||
a90482de8c | |||
261bbee1a4 | |||
fcf492c661 |
@ -13,40 +13,32 @@ executors:
|
||||
nodejs:
|
||||
docker:
|
||||
- image: node:18
|
||||
resource_class: medium
|
||||
resource_class: small
|
||||
|
||||
|
||||
jobs:
|
||||
python-test:
|
||||
executor: python
|
||||
working_directory: ~/scwrypts/py/lib
|
||||
working_directory: ./py/lib
|
||||
steps:
|
||||
- checkout:
|
||||
path: ~/scwrypts
|
||||
- run:
|
||||
name: pytest
|
||||
command: |
|
||||
: \
|
||||
&& pip install . .[test] \
|
||||
&& pytest \
|
||||
;
|
||||
- run: pip install build && python -m build
|
||||
- run: |
|
||||
: \
|
||||
&& pip install -e . \
|
||||
&& pytest \
|
||||
;
|
||||
|
||||
python-publish:
|
||||
executor: python
|
||||
working_directory: ~/scwrypts/py/lib
|
||||
steps:
|
||||
- checkout:
|
||||
path: ~/scwrypts
|
||||
- run: pip install build && python -m build
|
||||
- checkout
|
||||
- python/dist
|
||||
- run: pip install twine && twine upload dist/*
|
||||
|
||||
nodejs-test:
|
||||
nodesjs-test:
|
||||
executor: nodejs
|
||||
working_directory: ~/scwrypts/zx/lib
|
||||
working_directory: ./zx/lib
|
||||
steps:
|
||||
- checkout:
|
||||
path: ~/scwrypts
|
||||
- checkout
|
||||
|
||||
- restore_cache:
|
||||
name: restore pnpm cache
|
||||
@ -69,14 +61,12 @@ jobs:
|
||||
|
||||
- run: pnpm test
|
||||
- run: pnpm lint
|
||||
- run: pnpm build
|
||||
|
||||
nodejs-publish:
|
||||
nodesjs-publish:
|
||||
executor: nodejs
|
||||
working_directory: ~/scwrypts/zx/lib
|
||||
working_directory: ./zx/lib
|
||||
steps:
|
||||
- checkout:
|
||||
path: ~/scwrypts
|
||||
- checkout
|
||||
|
||||
- restore_cache:
|
||||
name: restore pnpm cache
|
||||
@ -97,62 +87,23 @@ jobs:
|
||||
paths:
|
||||
- .pnpm-store
|
||||
|
||||
- run:
|
||||
name: publish
|
||||
command: |
|
||||
: \
|
||||
&& [ $CIRCLE_TAG ] \
|
||||
&& pnpm build \
|
||||
&& pnpm version $CIRCLE_TAG \
|
||||
&& pnpm set //registry.npmjs.org/:_authToken=$NPM_TOKEN \
|
||||
&& pnpm publish --no-git-checks \
|
||||
;
|
||||
- run: pnpm build
|
||||
- run: pnpm version $(git describe --tags)
|
||||
|
||||
|
||||
workflows:
|
||||
python-dev:
|
||||
build:
|
||||
jobs:
|
||||
- python-test:
|
||||
filters:
|
||||
branches:
|
||||
ignore: /^main$/
|
||||
|
||||
python:
|
||||
jobs:
|
||||
- python-test:
|
||||
filters:
|
||||
tags:
|
||||
only: /^v\d+\.\d+\.\d+.*$/
|
||||
branches:
|
||||
ignore: /^.*$/
|
||||
- python-test
|
||||
- python-publish:
|
||||
requires: [python-test]
|
||||
context: [pypi-yage]
|
||||
filters:
|
||||
tags:
|
||||
only: /^v\d+\.\d+\.\d+.*$/
|
||||
branches:
|
||||
ignore: /^.*$/
|
||||
only: main
|
||||
|
||||
nodejs-dev:
|
||||
jobs:
|
||||
- nodejs-test:
|
||||
filters:
|
||||
branches:
|
||||
ignore: /^main$/
|
||||
|
||||
nodejs:
|
||||
jobs:
|
||||
- nodejs-test:
|
||||
filters:
|
||||
tags:
|
||||
only: /^v\d+\.\d+\.\d+.*$/
|
||||
branches:
|
||||
ignore: /^.*$/
|
||||
- nodejs-test
|
||||
- nodejs-publish:
|
||||
requires: [nodejs-test]
|
||||
context: [npm-wrynegade]
|
||||
filters:
|
||||
tags:
|
||||
only: /^v\d+\.\d+\.\d+.*$/
|
||||
branches:
|
||||
ignore: /^.*$/
|
||||
only: main
|
||||
|
@ -29,7 +29,6 @@ runs:
|
||||
repository: wrynegade/scwrypts
|
||||
path: ./wrynegade/scwrypts
|
||||
ref: ${{ inputs.version }}
|
||||
fetch-tags: true
|
||||
|
||||
- name: check dependencies
|
||||
shell: bash
|
||||
@ -52,7 +51,7 @@ runs:
|
||||
} > $HOME/.scwrypts.apt-get.log 2>&1
|
||||
|
||||
echo "updating virtual dependencies"
|
||||
$GITHUB_WORKSPACE/wrynegade/scwrypts/scwrypts \
|
||||
$GITHUB_WORKSPACE/wrynegade/scwrypts/scwrypts -n \
|
||||
--name scwrypts/virtualenv/update-all \
|
||||
--group scwrypts \
|
||||
--type zsh \
|
||||
|
3
py/lib/.gitignore
vendored
3
py/lib/.gitignore
vendored
@ -1,4 +1 @@
|
||||
dist/
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*.so
|
||||
|
@ -55,5 +55,6 @@ source = 'versioningit'
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ['./']
|
||||
|
||||
[tool.versioningit.vcs]
|
||||
match = ['v[0-9]*.[0-9]*.[0-9]*']
|
||||
[tool.versioningit]
|
||||
match = ['v*']
|
||||
|
||||
|
@ -41,7 +41,7 @@ def scwrypts(*args, patterns=None, name=None, group=None, _type=None, log_level=
|
||||
depth = int(depth) + 1
|
||||
|
||||
return run(
|
||||
f'SUBSCWRYPT={depth} {executable} {" ".join(pre_args)} -- {" ".join(args)}',
|
||||
f'SUBSCWRYPT={depth} {executable} {pre_args} -- {" ".join(args)}',
|
||||
shell=True,
|
||||
executable='/bin/zsh',
|
||||
check=False,
|
||||
|
@ -15,31 +15,26 @@ ERROR() { # command encountered an error
|
||||
SUCCESS() { # command completed successfully
|
||||
[[ $SCWRYPTS_LOG_LEVEL -ge 1 ]] \
|
||||
&& PREFIX="SUCCESS ✔" COLOR=$__GREEN PRINT "$@"
|
||||
return 0
|
||||
}
|
||||
|
||||
REMINDER() { # include sysadmin reminder or other important notice to users
|
||||
[[ $SCWRYPTS_LOG_LEVEL -ge 1 ]] \
|
||||
&& PREFIX="REMINDER " COLOR=$__BRIGHT_MAGENTA PRINT "$@"
|
||||
return 0
|
||||
}
|
||||
|
||||
STATUS() { # general status updates (prefer this to generic 'echo')
|
||||
[[ $SCWRYPTS_LOG_LEVEL -ge 2 ]] \
|
||||
&& PREFIX="STATUS " COLOR=$__BLUE PRINT "$@"
|
||||
return 0
|
||||
}
|
||||
|
||||
WARNING() { # warning-level messages; not errors
|
||||
[[ $SCWRYPTS_LOG_LEVEL -ge 3 ]] \
|
||||
&& PREFIX="WARNING " COLOR=$__YELLOW PRINT "$@"
|
||||
return 0
|
||||
}
|
||||
|
||||
DEBUG() { # helpful during development or (sparingly) to help others' development
|
||||
[[ $SCWRYPTS_LOG_LEVEL -ge 4 ]] \
|
||||
&& PREFIX="DEBUG ℹ" COLOR=$__WHITE PRINT "$@"
|
||||
return 0
|
||||
}
|
||||
|
||||
PROMPT() { # you probably want to use yN or INPUT from below
|
||||
@ -47,7 +42,6 @@ PROMPT() { # you probably want to use yN or INPUT from below
|
||||
&& PREFIX="PROMPT " COLOR=$__CYAN PRINT "$@" \
|
||||
&& PREFIX="USER ⌨" COLOR=$__BRIGHT_CYAN PRINT '' --no-line-end \
|
||||
;
|
||||
return 0
|
||||
}
|
||||
|
||||
FAIL() { SCWRYPTS_LOG_LEVEL=1 ERROR "${@:2}"; exit $1; }
|
||||
@ -217,21 +211,15 @@ READ_YN() { # yes/no read is suprisingly tricky
|
||||
local yn
|
||||
PROMPT "${USERPROMPT[@]}"
|
||||
|
||||
local PERFORM_FAKE_PROMPT=false
|
||||
case $SKIP_USER_INPUT in
|
||||
true ) yn=y ;;
|
||||
false )
|
||||
[[ $SCWRYPTS_LOG_LEVEL -lt 1 ]] && {
|
||||
[[ $FORCE_USER_INPUT =~ false ]] && [ ! -t 0 ] \
|
||||
|| PERFORM_FAKE_PROMPT=true
|
||||
}
|
||||
|
||||
[[ $PERFORM_FAKE_PROMPT =~ true ]] \
|
||||
[[ $FORCE_USER_INPUT =~ true ]] && [[ $SCWRYPTS_LOG_LEVEL -lt 1 ]] \
|
||||
&& echo -n "${USERPROMPT[@]} : " >&2
|
||||
|
||||
READ ${READ_ARGS[@]} -s -k yn
|
||||
|
||||
[[ $PERFORM_FAKE_PROMPT =~ true ]] \
|
||||
[[ $FORCE_USER_INPUT =~ true ]] && [[ $SCWRYPTS_LOG_LEVEL -lt 1 ]] \
|
||||
&& echo $yn >&2
|
||||
;;
|
||||
esac
|
||||
|
@ -26,7 +26,6 @@
|
||||
"prettier": "^3.2.5",
|
||||
"ts-jest": "^29.1.2",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.3.3",
|
||||
"uuid": "^9.0.1"
|
||||
},
|
||||
"eslintConfig": {
|
||||
|
3
zx/lib/pnpm-lock.yaml
generated
3
zx/lib/pnpm-lock.yaml
generated
@ -43,9 +43,6 @@ devDependencies:
|
||||
ts-node:
|
||||
specifier: ^10.9.2
|
||||
version: 10.9.2(@types/node@20.11.19)(typescript@5.3.3)
|
||||
typescript:
|
||||
specifier: ^5.3.3
|
||||
version: 5.3.3
|
||||
uuid:
|
||||
specifier: ^9.0.1
|
||||
version: 9.0.1
|
||||
|
@ -64,9 +64,11 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe('exact lookup', () => {
|
||||
let output;
|
||||
beforeEach(async () => {
|
||||
sample.spy.getScwryptsLookup.mockReturnValue(sample.lookup.exact);
|
||||
await scwrypts(sample.options);
|
||||
|
||||
output = await scwrypts(sample.options);
|
||||
});
|
||||
|
||||
test('gets the correct lookup', () => {
|
||||
@ -96,6 +98,7 @@ describe('exact lookup', () => {
|
||||
describe('patterns lookup', () => {
|
||||
beforeEach(async () => {
|
||||
sample.spy.getScwryptsLookup.mockReturnValue(sample.lookup.patterns);
|
||||
|
||||
await scwrypts(sample.options);
|
||||
});
|
||||
|
||||
|
6
zx/package-lock.json
generated
6
zx/package-lock.json
generated
@ -31,7 +31,6 @@
|
||||
"prettier": "^3.2.5",
|
||||
"ts-jest": "^29.1.2",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.3.3",
|
||||
"uuid": "^9.0.1"
|
||||
}
|
||||
},
|
||||
@ -4998,6 +4997,7 @@
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
@ -8596,7 +8596,6 @@
|
||||
"prettier": "^3.2.5",
|
||||
"ts-jest": "^29.1.2",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.3.3",
|
||||
"uuid": "^9.0.1"
|
||||
}
|
||||
},
|
||||
@ -8885,7 +8884,8 @@
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"peer": true
|
||||
},
|
||||
"undici-types": {
|
||||
"version": "5.26.5",
|
||||
|
Reference in New Issue
Block a user