mat3ra-utils 2024.3.26.post0__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.
Files changed (60) hide show
  1. mat3ra-utils-2024.3.26.post0/.babelrc +16 -0
  2. mat3ra-utils-2024.3.26.post0/.eslintignore +3 -0
  3. mat3ra-utils-2024.3.26.post0/.eslintrc.json +3 -0
  4. mat3ra-utils-2024.3.26.post0/.github/workflows/cicd.yml +150 -0
  5. mat3ra-utils-2024.3.26.post0/.gitignore +172 -0
  6. mat3ra-utils-2024.3.26.post0/.husky/pre-commit +14 -0
  7. mat3ra-utils-2024.3.26.post0/.mocharc.json +5 -0
  8. mat3ra-utils-2024.3.26.post0/.npmignore +5 -0
  9. mat3ra-utils-2024.3.26.post0/.nycrc +7 -0
  10. mat3ra-utils-2024.3.26.post0/.pre-commit-config.yaml +19 -0
  11. mat3ra-utils-2024.3.26.post0/.prettierrc +6 -0
  12. mat3ra-utils-2024.3.26.post0/LICENSE.md +15 -0
  13. mat3ra-utils-2024.3.26.post0/PKG-INFO +45 -0
  14. mat3ra-utils-2024.3.26.post0/README.md +5 -0
  15. mat3ra-utils-2024.3.26.post0/package-lock.json +6303 -0
  16. mat3ra-utils-2024.3.26.post0/package.json +84 -0
  17. mat3ra-utils-2024.3.26.post0/pyproject.toml +77 -0
  18. mat3ra-utils-2024.3.26.post0/setup.cfg +4 -0
  19. mat3ra-utils-2024.3.26.post0/src/js/browser/specific/codemirror.ts +8 -0
  20. mat3ra-utils-2024.3.26.post0/src/js/index.ts +32 -0
  21. mat3ra-utils-2024.3.26.post0/src/js/index_browser.ts +12 -0
  22. mat3ra-utils-2024.3.26.post0/src/js/index_server.ts +12 -0
  23. mat3ra-utils-2024.3.26.post0/src/js/server/file.js +78 -0
  24. mat3ra-utils-2024.3.26.post0/src/js/shared/array.js +29 -0
  25. mat3ra-utils-2024.3.26.post0/src/js/shared/class.js +76 -0
  26. mat3ra-utils-2024.3.26.post0/src/js/shared/clone.js +8 -0
  27. mat3ra-utils-2024.3.26.post0/src/js/shared/constants.js +39 -0
  28. mat3ra-utils-2024.3.26.post0/src/js/shared/hash.ts +24 -0
  29. mat3ra-utils-2024.3.26.post0/src/js/shared/math.ts +242 -0
  30. mat3ra-utils-2024.3.26.post0/src/js/shared/object.ts +263 -0
  31. mat3ra-utils-2024.3.26.post0/src/js/shared/selector.js +20 -0
  32. mat3ra-utils-2024.3.26.post0/src/js/shared/specific/filter.ts +73 -0
  33. mat3ra-utils-2024.3.26.post0/src/js/shared/specific/github.js +38 -0
  34. mat3ra-utils-2024.3.26.post0/src/js/shared/specific/index.ts +3 -0
  35. mat3ra-utils-2024.3.26.post0/src/js/shared/specific/timestampable.ts +6 -0
  36. mat3ra-utils-2024.3.26.post0/src/js/shared/str.js +108 -0
  37. mat3ra-utils-2024.3.26.post0/src/js/shared/tree.js +16 -0
  38. mat3ra-utils-2024.3.26.post0/src/js/shared/url.js +9 -0
  39. mat3ra-utils-2024.3.26.post0/src/js/shared/uuid.js +5 -0
  40. mat3ra-utils-2024.3.26.post0/src/py/__init__.py +0 -0
  41. mat3ra-utils-2024.3.26.post0/src/py/mat3ra/__init__.py +0 -0
  42. mat3ra-utils-2024.3.26.post0/src/py/mat3ra/utils/__init__.py +5 -0
  43. mat3ra-utils-2024.3.26.post0/src/py/mat3ra_utils.egg-info/PKG-INFO +45 -0
  44. mat3ra-utils-2024.3.26.post0/src/py/mat3ra_utils.egg-info/SOURCES.txt +58 -0
  45. mat3ra-utils-2024.3.26.post0/src/py/mat3ra_utils.egg-info/dependency_links.txt +1 -0
  46. mat3ra-utils-2024.3.26.post0/src/py/mat3ra_utils.egg-info/requires.txt +13 -0
  47. mat3ra-utils-2024.3.26.post0/src/py/mat3ra_utils.egg-info/top_level.txt +1 -0
  48. mat3ra-utils-2024.3.26.post0/tests/js/class.tests.ts +111 -0
  49. mat3ra-utils-2024.3.26.post0/tests/js/clone.tests.ts +31 -0
  50. mat3ra-utils-2024.3.26.post0/tests/js/file.tests.ts +11 -0
  51. mat3ra-utils-2024.3.26.post0/tests/js/filter.tests.ts +86 -0
  52. mat3ra-utils-2024.3.26.post0/tests/js/object.tests.ts +92 -0
  53. mat3ra-utils-2024.3.26.post0/tests/js/str.tests.ts +18 -0
  54. mat3ra-utils-2024.3.26.post0/tests/js/tree.tests.ts +34 -0
  55. mat3ra-utils-2024.3.26.post0/tests/js/url.tests.ts +13 -0
  56. mat3ra-utils-2024.3.26.post0/tests/py/__init__.py +0 -0
  57. mat3ra-utils-2024.3.26.post0/tests/py/unit/__init__.py +0 -0
  58. mat3ra-utils-2024.3.26.post0/tests/py/unit/test_sample.py +10 -0
  59. mat3ra-utils-2024.3.26.post0/tsconfig-transpile.json +3 -0
  60. mat3ra-utils-2024.3.26.post0/tsconfig.json +3 -0
@@ -0,0 +1,16 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ "targets": {
7
+ "node": "current"
8
+ }
9
+ }
10
+ ],
11
+ "@babel/preset-typescript"
12
+ ],
13
+ "plugins": [
14
+ "@babel/plugin-proposal-class-properties"
15
+ ]
16
+ }
@@ -0,0 +1,3 @@
1
+ dist/
2
+ src/py
3
+ test/py
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": ["@exabyte-io/eslint-config"]
3
+ }
@@ -0,0 +1,150 @@
1
+ name: Continuous Testing and Publication
2
+
3
+ on: [push]
4
+
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
9
+ jobs:
10
+ run-py-linter:
11
+ runs-on: ubuntu-20.04
12
+ strategy:
13
+ matrix:
14
+ python-version: [3.8.6]
15
+
16
+ steps:
17
+ - name: Checkout this repository
18
+ uses: actions/checkout@v4
19
+ with:
20
+ lfs: true
21
+
22
+ - name: Checkout actions repository
23
+ uses: actions/checkout@v4
24
+ with:
25
+ repository: Exabyte-io/actions
26
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
27
+ path: actions
28
+
29
+ - name: Run ruff linter
30
+ uses: ./actions/py/lint
31
+ with:
32
+ python-version: ${{ matrix.python-version }}
33
+
34
+ run-py-tests:
35
+ needs: run-py-linter
36
+ runs-on: ubuntu-20.04
37
+ strategy:
38
+ matrix:
39
+ python-version:
40
+ - 3.8.x
41
+ - 3.9.x
42
+ - 3.10.x
43
+ - 3.11.x
44
+
45
+ steps:
46
+ - name: Checkout this repository
47
+ uses: actions/checkout@v4
48
+ with:
49
+ lfs: true
50
+
51
+ - name: Checkout actions repository
52
+ uses: actions/checkout@v4
53
+ with:
54
+ repository: Exabyte-io/actions
55
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
56
+ path: actions
57
+
58
+ - name: Run python unit tests
59
+ uses: ./actions/py/test
60
+ with:
61
+ python-version: ${{ matrix.python-version }}
62
+ unit-test-directory: tests/py/unit
63
+ bot-ssh-key: ${{ secrets.BOT_GITHUB_KEY }}
64
+
65
+ run-js-tests:
66
+ runs-on: ubuntu-latest
67
+ strategy:
68
+ matrix:
69
+ node-version:
70
+ - 14.x
71
+ - 20.x
72
+
73
+ steps:
74
+ - name: Checkout this repository
75
+ uses: actions/checkout@v4
76
+ with:
77
+ lfs: true
78
+
79
+ - name: Checkout actions repository
80
+ uses: actions/checkout@v4
81
+ with:
82
+ repository: Exabyte-io/actions
83
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
84
+ path: actions
85
+
86
+ - name: Run JS validate
87
+ uses: ./actions/js/validate
88
+ with:
89
+ node-version: '14.x'
90
+ skip-eslint: 'true'
91
+
92
+ - name: Run JS tests
93
+ uses: ./actions/js/test
94
+ with:
95
+ node-version: ${{ matrix.node-version }}
96
+
97
+ publish-js-package:
98
+ needs:
99
+ - run-js-tests
100
+ - run-py-tests
101
+ - run-py-linter
102
+ runs-on: ubuntu-latest
103
+ if: (github.repository != 'Exabyte-io/template-definitions-js-py') && (github.ref_name == 'main')
104
+
105
+ steps:
106
+ - name: Checkout this repository
107
+ uses: actions/checkout@v4
108
+
109
+ - name: Checkout actions repository
110
+ uses: actions/checkout@v4
111
+ with:
112
+ repository: Exabyte-io/actions
113
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
114
+ path: actions
115
+
116
+ - name: Publish JS release
117
+ uses: ./actions/js/publish
118
+ with:
119
+ node-version: 14.19.x
120
+ npm-token: ${{ secrets.NPM_TOKEN }}
121
+ github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
122
+
123
+ publish-py-package:
124
+ needs:
125
+ - run-js-tests
126
+ - run-py-tests
127
+ - run-py-linter
128
+ runs-on: ubuntu-latest
129
+ if: (github.repository != 'Exabyte-io/template-definitions-js-py') && (github.ref_name == 'main')
130
+
131
+ steps:
132
+ - name: Checkout this repository
133
+ uses: actions/checkout@v4
134
+ with:
135
+ lfs: true
136
+
137
+ - name: Checkout actions repository
138
+ uses: actions/checkout@v4
139
+ with:
140
+ repository: Exabyte-io/actions
141
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
142
+ path: actions
143
+
144
+ - name: Publish python release
145
+ uses: ./actions/py/publish
146
+ with:
147
+ python-version: 3.8.x
148
+ github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
149
+ pypi-api-token: ${{ secrets.PYPI_API_TOKEN }}
150
+ publish-tag: 'false'
@@ -0,0 +1,172 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ # "dist" folder is not ignored on purpose to be able to install intermediate changes from github commits
11
+ # dist
12
+ .Python
13
+ build/
14
+ develop-eggs/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # poetry
99
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103
+ #poetry.lock
104
+
105
+ # pdm
106
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107
+ #pdm.lock
108
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109
+ # in version control.
110
+ # https://pdm.fming.dev/#use-with-ide
111
+ .pdm.toml
112
+
113
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
114
+ __pypackages__/
115
+
116
+ # Celery stuff
117
+ celerybeat-schedule
118
+ celerybeat.pid
119
+
120
+ # SageMath parsed files
121
+ *.sage.py
122
+
123
+ # Environments
124
+ .env
125
+ .venv
126
+ env/
127
+ venv/
128
+ ENV/
129
+ env.bak/
130
+ venv.bak/
131
+
132
+ # Spyder project settings
133
+ .spyderproject
134
+ .spyproject
135
+
136
+ # Rope project settings
137
+ .ropeproject
138
+
139
+ # mkdocs documentation
140
+ /site
141
+
142
+ # mypy
143
+ .mypy_cache/
144
+ .dmypy.json
145
+ dmypy.json
146
+
147
+ # Pyre type checker
148
+ .pyre/
149
+
150
+ # pytype static type analyzer
151
+ .pytype/
152
+
153
+ # Cython debug symbols
154
+ cython_debug/
155
+
156
+ # PyCharm
157
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
159
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
160
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
161
+ .idea/
162
+
163
+ # Ruff
164
+ .ruff_cache/
165
+
166
+ ########### JAVASCRIPT #############
167
+ node_modules/
168
+ .eslintcache
169
+ .nyc_output/
170
+
171
+ ########### GENERAL #############
172
+ *.DS_Store
@@ -0,0 +1,14 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ #### Below is an example of how to rebuild JS and PY assets if JSON assets have changed.
5
+ # SRC_PATTERN="\.json$"
6
+ # if git diff --cached --name-only | grep --quiet -E "$SRC_PATTERN"
7
+ # then
8
+ # echo "JSON assets changed. Running build scripts."
9
+ # echo "Re-building JS and PY assets using JS script."
10
+ # npm run build:js-and-python-modules
11
+ # fi
12
+
13
+ # Automatically lint staged files in pre-commit hook
14
+ npx lint-staged
@@ -0,0 +1,5 @@
1
+ {
2
+ "extension": ["ts"],
3
+ "spec": "tests/js/**/*.tests.*",
4
+ "require": "ts-node/register"
5
+ }
@@ -0,0 +1,5 @@
1
+ src/py/
2
+ tests/
3
+ pyproject.toml
4
+ .github
5
+ .husky
@@ -0,0 +1,7 @@
1
+ {
2
+ "all": true,
3
+ "include": [
4
+ "src/**/*.js",
5
+ "src/**/*.jsx"
6
+ ]
7
+ }
@@ -0,0 +1,19 @@
1
+ repos:
2
+ - repo: https://github.com/Exabyte-io/pre-commit-hooks
3
+ rev: 2023.6.28
4
+ hooks:
5
+ - id: ruff
6
+ - id: black
7
+ - id: isort
8
+ - id: mypy
9
+ - id: check-yaml
10
+ - id: end-of-file-fixer
11
+ - id: trailing-whitespace
12
+ - repo: local
13
+ hooks:
14
+ - id: lint-staged
15
+ name: lint-staged
16
+ language: node
17
+ entry: npx lint-staged
18
+ verbose: true # to see familiar lint-staged output
19
+ pass_filenames: false # lint-staged has its own glob expression
@@ -0,0 +1,6 @@
1
+ {
2
+ "singleQuote": false,
3
+ "printWidth": 100,
4
+ "trailingComma": "all",
5
+ "tabWidth": 4
6
+ }
@@ -0,0 +1,15 @@
1
+ # LICENSE
2
+
3
+ Copyright 2024 Exabyte Inc.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
@@ -0,0 +1,45 @@
1
+ Metadata-Version: 2.1
2
+ Name: mat3ra-utils
3
+ Version: 2024.3.26.post0
4
+ Summary: Utils.
5
+ Author-email: "Exabyte Inc." <info@mat3ra.com>
6
+ License: # LICENSE
7
+
8
+ Copyright 2024 Exabyte Inc.
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ Classifier: Programming Language :: Python
23
+ Classifier: Programming Language :: Python :: 3
24
+ Classifier: Development Status :: 3 - Alpha
25
+ Classifier: Topic :: Software Development
26
+ Requires-Python: >=3.8
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE.md
29
+ Requires-Dist: numpy
30
+ Provides-Extra: tests
31
+ Requires-Dist: coverage[toml]>=5.3; extra == "tests"
32
+ Requires-Dist: pre-commit; extra == "tests"
33
+ Requires-Dist: black; extra == "tests"
34
+ Requires-Dist: ruff; extra == "tests"
35
+ Requires-Dist: isort; extra == "tests"
36
+ Requires-Dist: mypy; extra == "tests"
37
+ Requires-Dist: pip-tools; extra == "tests"
38
+ Provides-Extra: all
39
+ Requires-Dist: mat3ra-utils[tests]; extra == "all"
40
+
41
+ # utils
42
+
43
+ A dual repository (JavaScript and Python) containing basic utils for development.
44
+
45
+ Minimum external dependencies should be used in order to keep the repository lightweight.
@@ -0,0 +1,5 @@
1
+ # utils
2
+
3
+ A dual repository (JavaScript and Python) containing basic utils for development.
4
+
5
+ Minimum external dependencies should be used in order to keep the repository lightweight.