Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mincrmatt12/nmfu
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.0a2
Choose a base ref
...
head repository: mincrmatt12/nmfu
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 5,900 additions and 1,049 deletions.
  1. +5 −1 .gitignore
  2. +14 −0 .readthedocs.yaml
  3. +5 −8 AppImageBuilder.yml
  4. +4 −2 Dockerfile.appimage
  5. +2 −1 Dockerfile.build
  6. +9 −32 Jenkinsfile
  7. +8 −427 README.md
  8. +7 −0 docs/css/extra.css
  9. +15 −0 docs/index.md
  10. +4 −0 docs/requirements.txt
  11. +265 −0 docs/tutorial/http1.md
  12. +331 −0 docs/tutorial/http2.md
  13. +384 −0 docs/tutorial/lexer.md
  14. +71 −0 docs/user-ref/cli.md
  15. +104 −0 docs/user-ref/generated-code.md
  16. +534 −0 docs/user-ref/parser.md
  17. +4 −0 example/.gitignore
  18. +169 −0 example/gtfs-realtime.nmfu
  19. +12 −19 example/http.nmfu
  20. +19 −4 example/http_test.c
  21. +22 −0 example/lexer.nmfu
  22. +62 −0 example/lexer_test.c
  23. +9 −0 example/test/binary0.ok.nmfu
  24. +3 −0 example/test/binary1.fail.nmfu
  25. +6 −0 example/test/bitwise-ops.ok.nmfu
  26. +6 −1 example/test/case0.ok.nmfu
  27. +1 −1 example/test/case1.fail.nmfu
  28. +15 −2 example/test/case2.ok.nmfu
  29. +22 −0 example/test/case3.ok.nmfu
  30. +17 −0 example/test/case4.ok.nmfu
  31. +9 −0 example/test/condition-break0.ok.nmfu
  32. +14 −0 example/test/condition-break1.ok.nmfu
  33. +13 −0 example/test/condition-break2.ok.nmfu
  34. +14 −0 example/test/condition-foreach.ok.nmfu
  35. +22 −0 example/test/condition0.ok.nmfu
  36. +11 −0 example/test/condition1.fail.nmfu
  37. +14 −0 example/test/condition2.ok.nmfu
  38. +15 −0 example/test/condition3.ok.nmfu
  39. +13 −0 example/test/condition4.ok.nmfu
  40. +6 −0 example/test/duplicate0.fail.nmfu
  41. +6 −0 example/test/duplicate1.fail.nmfu
  42. +9 −0 example/test/duplicate2.fail.nmfu
  43. +6 −0 example/test/duplicate3.fail.nmfu
  44. +5 −0 example/test/duplicate4.fail.nmfu
  45. +4 −0 example/test/empty-append.ok.nmfu
  46. +10 −0 example/test/empty-foreach.fail.nmfu
  47. +7 −0 example/test/empty-loop.fail.nmfu
  48. +11 −0 example/test/end-match.fail.nmfu
  49. +15 −0 example/test/foreach-after-action.ok.nmfu
  50. +2 −2 example/test/foreach-number.ok.nmfu
  51. +13 −0 example/test/greedycase.fail.nmfu
  52. +10 −0 example/test/int-literals.ok.nmfu
  53. +14 −0 example/test/loop-inverted-append.ok.nmfu
  54. +7 −0 example/test/loop-repeat-ambig.fail.nmfu
  55. +19 −0 example/test/macro-arg0.fail.nmfu
  56. +19 −0 example/test/macro-arg1.fail.nmfu
  57. +46 −0 example/test/macro.ok.nmfu
  58. +10 −0 example/test/nested-loop-break.ok.nmfu
  59. +4 −0 example/test/optional0.ok.nmfu
  60. +7 −1 example/test/optional1.ok.nmfu
  61. +1 −1 example/test/optional3.fail.nmfu
  62. +6 −0 example/test/optional4.fail.nmfu
  63. +8 −0 example/test/raw0.ok.nmfu
  64. +6 −0 example/test/strict-schedule0.fail.nmfu
  65. +9 −0 example/test/strict-schedule1.fail.nmfu
  66. +9 −0 example/test/strict-schedule2.ok.nmfu
  67. +10 −0 example/test/string-ops.ok.nmfu
  68. +17 −0 example/test/string-types.ok.nmfu
  69. +17 −0 example/test/try-actions0.ok.nmfu
  70. +13 −0 example/test/try-actions1.ok.nmfu
  71. +4 −0 example/test/try-correct-else-detection.ok.nmfu
  72. +4 −0 example/test/try-fallthrough-finish.ok.nmfu
  73. +35 −0 example/test/try-nested.ok.nmfu
  74. +30 −4 example/ttc_rdf.nmfu
  75. +28 −0 mkdocs.yml
  76. +2,950 −508 nmfu.py
  77. +3 −0 pyproject.toml
  78. +4 −3 setup.py
  79. +1 −2 snapcraft.yaml
  80. +4 −4 tests/test_actions.py
  81. +42 −0 tests/test_arguments.py
  82. +4 −4 tests/test_case_merge.py
  83. +29 −0 tests/test_condition_point.py
  84. +17 −0 tests/test_debugdata.py
  85. +80 −19 tests/test_full_integration.py
  86. +33 −0 tests/test_pctx.py
  87. +1 −1 tests/test_regex.py
  88. +51 −2 tests/test_state.py
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.vim/*
*.pyc
*.pdf
*.dot
*.png
*.egg-info

@@ -18,5 +19,8 @@ AppDir/
appimage-builder-cache/
.pytest_cache/

.coverage
.coverage*
htmlcov/
coverage.xml

appimage-build/
14 changes: 14 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2

build:
os: ubuntu-20.04
tools:
python: "3.9"

mkdocs:
configuration: mkdocs.yml

python:
install:
- requirements: docs/requirements.txt

13 changes: 5 additions & 8 deletions AppImageBuilder.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ script:
# Build wheel
- python3 setup.py bdist_wheel
# Install application dependencies
- python3 -m pip install --ignore-installed --prefix=/usr --system --root=$PWD/AppDir dist/nmfu-0.3.0a2-py3-none-any.whl
- python3 -m pip install --ignore-installed --prefix=/usr --system --root=$PWD/AppDir dist/nmfu-0.5.7-py3-none-any.whl

AppDir:
path: ./AppDir
@@ -14,23 +14,20 @@ AppDir:
id: xyz.mm12.nmfu
name: nmfu
icon: utilities-terminal
version: 0.3.0a2
version: 0.5.7
exec: usr/bin/python3
exec_args: "$APPDIR/usr/bin/nmfu $@"

apt:
arch: amd64
sources:
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse'
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse'
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
include:
- python3
- python3-pkg-resources

runtime:
env:
PYTHONHOME: '${APPDIR}/usr'
PYTHONPATH: '${APPDIR}/usr/lib/python3.6/site-packages'
after_runtime: |
sed -i 's/Terminal=false/Terminal=true/' "$TARGET_APPDIR/xyz.mm12.nmfu.desktop"
AppImage:
arch: x86_64
6 changes: 4 additions & 2 deletions Dockerfile.appimage
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM appimagecrafters/appimage-builder
FROM appimagecrafters/appimage-builder:1.1.0

RUN apt-get update && apt-get install -y --no-install-recommends adwaita-icon-theme && rm -rf /var/lib/apt/lists/*
ENV XDG_DATA_DIRS "/usr/share:/usr/local/share"

RUN apt-get update && apt-get install -y --no-install-recommends adwaita-icon-theme squashfs-tools && rm -rf /var/lib/apt/lists/*
3 changes: 2 additions & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM python:3

RUN apt-get update && apt-get install gcc -y --no-install-recommends
RUN pip install twine

WORKDIR /data
COPY . /data

RUN pip install .[tests]
RUN pip install .[tests,coverage] && pip uninstall -y nmfu
41 changes: 9 additions & 32 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -14,11 +14,12 @@ pipeline {
}
}
environment {
TAG_BUILD = """${sh(returnStdout: true, script: 'bash -c "[[ \\$TAG_NAME ]] && echo \' \' || echo -n dev0+git-${GIT_COMMIT}"')}"""
TAG_BUILD = """${sh(returnStdout: true, script: 'bash -c "[[ \\$TAG_NAME ]] && echo -n \'\' || echo -n --tag-build \\\'dev0+git-${GIT_COMMIT}\\\'"')}"""
}
steps {
sh "rm dist/* || true"
sh "python setup.py egg_info --tag-build '${TAG_BUILD}' sdist bdist_wheel"
sh "mkdir -p .venv; python -m venv .venv; .venv/bin/pip install setuptools wheel;"
sh ".venv/bin/python setup.py egg_info ${env.TAG_BUILD} sdist bdist_wheel"
archiveArtifacts artifacts: 'dist/*'
stash includes: 'dist/*', name: 'built'
}
@@ -30,9 +31,13 @@ pipeline {
filename 'Dockerfile.build'
}
}
environment {
PYTHONPATH="."
}
steps {
sh "pytest --junit-xml=junit.xml || true"
sh "pytest --junit-xml=junit.xml --cov-branch --cov=nmfu --cov-report=xml || true"
junit 'junit.xml'
recordCoverage sourceCodeRetention: 'EVERY_BUILD', tools: [[parser: 'COBERTURA', pattern: 'coverage.xml']]
}
}
stage('Deploy/Package') {
@@ -45,7 +50,6 @@ pipeline {
message 'Release this version of NMFU?'
ok 'Yes, do it!'
parameters {
choice(choices: ['stable', 'candidate', 'beta'], description: 'Which release channel should the snap be sent to?', name: 'SNAPCRAFT_RELEASE_CHANNEL')
choice(choices: ['pypi', 'testpypi'], description: 'Which registry should the package be sent to?', name: 'PYPI_REPOSITORY_NAME')
}
submitter 'matthew'
@@ -63,7 +67,7 @@ pipeline {
}
steps {
unstash name: 'built'
sh "twine upload -u $DPYPI_INFO_USR -p $DPYPI_INFO_PSW -r $PYPI_REPOSITORY_NAME --non-interactive dist/*"
sh 'twine upload -u $DPYPI_INFO_USR -p $DPYPI_INFO_PSW -r $PYPI_REPOSITORY_NAME --non-interactive dist/*'
}
}
stage('Generate AppImage') {
@@ -78,33 +82,6 @@ pipeline {
archiveArtifacts "*.AppImage"
}
}
stage ('Upload Snap') {
agent {
docker {
label "docker && linux"
image 'cibuilds/snapcraft:core18'
args "-u 0:0"
}
}
environment {
SNAP_LOGIN_FILE = credentials('snapcraft-login')
}
steps {
dir("snapbuild") {
sh "rm *.snap || true"
sh "cp ../README.md ../nmfu.py ../setup.py ../snapcraft.yaml ."
sh "apt-get update && snapcraft"
archiveArtifacts artifacts: '*.snap'
sh "snapcraft login --with $SNAP_LOGIN_FILE"
sh "snapcraft upload --release $SNAPCRAFT_RELEASE_CHANNEL *.snap"
}
}
post {
always {
sh "chmod -R a+rw \$PWD/"
}
}
}
}
}
}
Loading