deker-tools 1.0.0__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 (39) hide show
  1. deker_tools-1.0.0/.coveragerc +23 -0
  2. deker_tools-1.0.0/.dockerignore +292 -0
  3. deker_tools-1.0.0/.github/workflows/github-actions.yml +233 -0
  4. deker_tools-1.0.0/.gitignore +150 -0
  5. deker_tools-1.0.0/.pre-commit-config.yaml +156 -0
  6. deker_tools-1.0.0/LICENSE +674 -0
  7. deker_tools-1.0.0/MANIFEST.in +3 -0
  8. deker_tools-1.0.0/PKG-INFO +37 -0
  9. deker_tools-1.0.0/README.md +9 -0
  10. deker_tools-1.0.0/deker_tools/__init__.py +0 -0
  11. deker_tools-1.0.0/deker_tools/data.py +15 -0
  12. deker_tools-1.0.0/deker_tools/path.py +56 -0
  13. deker_tools-1.0.0/deker_tools/slices.py +361 -0
  14. deker_tools-1.0.0/deker_tools/time.py +27 -0
  15. deker_tools-1.0.0/deker_tools.egg-info/PKG-INFO +37 -0
  16. deker_tools-1.0.0/deker_tools.egg-info/SOURCES.txt +38 -0
  17. deker_tools-1.0.0/deker_tools.egg-info/dependency_links.txt +1 -0
  18. deker_tools-1.0.0/deker_tools.egg-info/requires.txt +1 -0
  19. deker_tools-1.0.0/deker_tools.egg-info/top_level.txt +1 -0
  20. deker_tools-1.0.0/docs/Makefile +20 -0
  21. deker_tools-1.0.0/docs/conf.py +120 -0
  22. deker_tools-1.0.0/docs/index.rst +59 -0
  23. deker_tools-1.0.0/docs/make.bat +35 -0
  24. deker_tools-1.0.0/docs/source/api/data.rst +8 -0
  25. deker_tools-1.0.0/docs/source/api/modules.rst +10 -0
  26. deker_tools-1.0.0/docs/source/api/path.rst +7 -0
  27. deker_tools-1.0.0/docs/source/api/slices.rst +7 -0
  28. deker_tools-1.0.0/docs/source/api/time.rst +7 -0
  29. deker_tools-1.0.0/pyproject.toml +96 -0
  30. deker_tools-1.0.0/requirements.txt +1 -0
  31. deker_tools-1.0.0/requirements_dev.txt +21 -0
  32. deker_tools-1.0.0/requirements_docs.txt +2 -0
  33. deker_tools-1.0.0/setup.cfg +67 -0
  34. deker_tools-1.0.0/setup.py +3 -0
  35. deker_tools-1.0.0/tests/__init__.py +0 -0
  36. deker_tools-1.0.0/tests/test_data.py +16 -0
  37. deker_tools-1.0.0/tests/test_path.py +33 -0
  38. deker_tools-1.0.0/tests/test_slices.py +185 -0
  39. deker_tools-1.0.0/tox.ini +36 -0
@@ -0,0 +1,23 @@
1
+ [run]
2
+ branch = True
3
+ omit =
4
+ tests/*
5
+ tmp.py
6
+ setup.py
7
+
8
+ [html]
9
+ directory = tests/code_coverage
10
+
11
+ [report]
12
+ fail_under=50
13
+ exclude_lines =
14
+ no cov
15
+ pragma: no cover
16
+ if typing.TYPE_CHECKING:
17
+ if TYPE_CHECKING:
18
+ if __name__ == .__main__.:
19
+ pass
20
+ raise NotImplementedError
21
+ except ImportError
22
+ except ModuleNotFoundError
23
+ except Exception
@@ -0,0 +1,292 @@
1
+ ### JetBrains template
2
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
3
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
4
+
5
+ # User-specific stuff
6
+ .idea/**/workspace.xml
7
+ .idea/**/tasks.xml
8
+ .idea/**/usage.statistics.xml
9
+ .idea/**/dictionaries
10
+ .idea/**/shelf
11
+
12
+ # Generated files
13
+ .idea/**/contentModel.xml
14
+
15
+ # Sensitive or high-churn files
16
+ .idea/**/dataSources/
17
+ .idea/**/dataSources.ids
18
+ .idea/**/dataSources.local.xml
19
+ .idea/**/sqlDataSources.xml
20
+ .idea/**/dynamic.xml
21
+ .idea/**/uiDesigner.xml
22
+ .idea/**/dbnavigator.xml
23
+
24
+ # Gradle
25
+ .idea/**/gradle.xml
26
+ .idea/**/libraries
27
+
28
+ # Gradle and Maven with auto-import
29
+ # When using Gradle or Maven with auto-import, you should exclude module files,
30
+ # since they will be recreated, and may cause churn. Uncomment if using
31
+ # auto-import.
32
+ # .idea/artifacts
33
+ # .idea/compiler.xml
34
+ # .idea/jarRepositories.xml
35
+ # .idea/modules.xml
36
+ # .idea/*.iml
37
+ # .idea/modules
38
+ # *.iml
39
+ # *.ipr
40
+
41
+ # CMake
42
+ cmake-build-*/
43
+
44
+ # Mongo Explorer plugin
45
+ .idea/**/mongoSettings.xml
46
+
47
+ # File-based project format
48
+ *.iws
49
+
50
+ # IntelliJ
51
+ out/
52
+
53
+ # mpeltonen/sbt-idea plugin
54
+ .idea_modules/
55
+
56
+ # JIRA plugin
57
+ atlassian-ide-plugin.xml
58
+
59
+ # Cursive Clojure plugin
60
+ .idea/replstate.xml
61
+
62
+ # Crashlytics plugin (for Android Studio and IntelliJ)
63
+ com_crashlytics_export_strings.xml
64
+ crashlytics.properties
65
+ crashlytics-build.properties
66
+ fabric.properties
67
+
68
+ # Editor-based Rest Client
69
+ .idea/httpRequests
70
+
71
+ # Android studio 3.1+ serialized cache file
72
+ .idea/caches/build_file_checksums.ser
73
+
74
+ ### VirtualEnv template
75
+ # Virtualenv
76
+ # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
77
+ .Python
78
+ [Bb]in
79
+ [Ii]nclude
80
+ [Ll]ib
81
+ [Ll]ib64
82
+ [Ll]ocal
83
+ [Ss]cripts
84
+ pyvenv.cfg
85
+ .venv
86
+ pip-selfcheck.json
87
+
88
+ ### Eclipse template
89
+ .metadata
90
+ bin/
91
+ tmp/
92
+ *.tmp
93
+ *.bak
94
+ *.swp
95
+ *~.nib
96
+ local.properties
97
+ .settings/
98
+ .loadpath
99
+ .recommenders
100
+
101
+ # External tool builders
102
+ .externalToolBuilders/
103
+
104
+ # Locally stored "Eclipse launch configurations"
105
+ *.launch
106
+
107
+ # PyDev specific (Python IDE for Eclipse)
108
+ *.pydevproject
109
+
110
+ # CDT-specific (C/C++ Development Tooling)
111
+ .cproject
112
+
113
+ # CDT- autotools
114
+ .autotools
115
+
116
+ # Java annotation processor (APT)
117
+ .factorypath
118
+
119
+ # PDT-specific (PHP Development Tools)
120
+ .buildpath
121
+
122
+ # sbteclipse plugin
123
+ .target
124
+
125
+ # Tern plugin
126
+ .tern-project
127
+
128
+ # TeXlipse plugin
129
+ .texlipse
130
+
131
+ # STS (Spring Tool Suite)
132
+ .springBeans
133
+
134
+ # Code Recommenders
135
+ .recommenders/
136
+
137
+ # Annotation Processing
138
+ .apt_generated/
139
+ .apt_generated_test/
140
+
141
+ # Scala IDE specific (Scala & Java development for Eclipse)
142
+ .cache-main
143
+ .scala_dependencies
144
+ .worksheet
145
+
146
+ # Uncomment this line if you wish to ignore the project description file.
147
+ # Typically, this file would be tracked if it contains build/dependency configurations:
148
+ #.project
149
+
150
+ ### Python template
151
+ # Byte-compiled / optimized / DLL files
152
+ __pycache__/
153
+ *.py[cod]
154
+ *$py.class
155
+
156
+ # C extensions
157
+ *.so
158
+
159
+ # Distribution / packaging
160
+ .Python
161
+ build/
162
+ develop-eggs/
163
+ dist/
164
+ downloads/
165
+ eggs/
166
+ .eggs/
167
+ lib/
168
+ lib64/
169
+ parts/
170
+ sdist/
171
+ var/
172
+ wheels/
173
+ share/python-wheels/
174
+ *.egg-info/
175
+ .installed.cfg
176
+ *.egg
177
+ MANIFEST
178
+
179
+ # PyInstaller
180
+ # Usually these files are written by a python script from a template
181
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
182
+ *.manifest
183
+ *.spec
184
+
185
+ # Installer logs
186
+ pip-log.txt
187
+ pip-delete-this-directory.txt
188
+
189
+ # Unit test / coverage reports
190
+ htmlcov/
191
+ .tox/
192
+ .nox/
193
+ .coverage
194
+ .coverage.*
195
+ .cache
196
+ nosetests.xml
197
+ coverage.xml
198
+ *.cover
199
+ *.py,cover
200
+ .hypothesis/
201
+ .pytest_cache/
202
+ cover/
203
+
204
+ # Translations
205
+ *.mo
206
+ *.pot
207
+
208
+ # Django stuff:
209
+ *.log
210
+ local_settings.py
211
+ db.sqlite3
212
+ db.sqlite3-journal
213
+
214
+ # Flask stuff:
215
+ instance/
216
+ .webassets-cache
217
+
218
+ # Scrapy stuff:
219
+ .scrapy
220
+
221
+ # Sphinx documentation
222
+ docs/_build/
223
+
224
+ # PyBuilder
225
+ .pybuilder/
226
+ target/
227
+
228
+ # Jupyter Notebook
229
+ .ipynb_checkpoints
230
+
231
+ # IPython
232
+ profile_default/
233
+ ipython_config.py
234
+
235
+ # pyenv
236
+ # For a library or package, you might want to ignore these files since the code is
237
+ # intended to run in multiple environments; otherwise, check them in:
238
+ # .python-version
239
+
240
+ # pipenv
241
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
242
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
243
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
244
+ # install all needed dependencies.
245
+ #Pipfile.lock
246
+
247
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
248
+ __pypackages__/
249
+
250
+ # Celery stuff
251
+ celerybeat-schedule
252
+ celerybeat.pid
253
+
254
+ # SageMath parsed files
255
+ *.sage.py
256
+
257
+ # Environments
258
+ .env
259
+ *.env
260
+ .venv
261
+ env/
262
+ venv/
263
+ ENV/
264
+ env.bak/
265
+ venv.bak/
266
+
267
+ # Spyder project settings
268
+ .spyderproject
269
+ .spyproject
270
+
271
+ # Rope project settings
272
+ .ropeproject
273
+
274
+ # mkdocs documentation
275
+ /site
276
+
277
+ # mypy
278
+ .mypy_cache/
279
+ .dmypy.json
280
+ dmypy.json
281
+
282
+ # Pyre type checker
283
+ .pyre/
284
+
285
+ # pytype static type analyzer
286
+ .pytype/
287
+
288
+ # Cython debug symbols
289
+ cython_debug/
290
+
291
+ # YOUR IGNORINGS HERE
292
+ */tmp.py
@@ -0,0 +1,233 @@
1
+ name: pipeline
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ env:
8
+ PYTHON_IMAGE: 3.9
9
+ DOCKER_IMAGE: docker:20.10.23
10
+ PYTHON_PACKAGE_NAME: deker_tools
11
+ DOCKER_REG_IMAGE: ${{ secrets.CI_REGISTRY_IMAGE }}
12
+
13
+ jobs:
14
+ setup:
15
+ runs-on: ubuntu-latest
16
+ timeout-minutes: 60
17
+
18
+ steps:
19
+ - name: Checkout code
20
+ uses: actions/checkout@v2
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v3
24
+ with:
25
+ python-version: ${{ env.PYTHON_IMAGE }}
26
+
27
+ - name: Install dependencies
28
+ run: |
29
+ pip install --upgrade pip
30
+ pip install virtualenv
31
+ virtualenv venv
32
+ source venv/bin/activate
33
+ pip install -r requirements.txt
34
+ pip install -r requirements_dev.txt
35
+ pip list
36
+
37
+ - name: Cache virtual environment
38
+ uses: actions/cache@v2
39
+ with:
40
+ path: venv
41
+ key: ${{ runner.os }}-venv-${{ env.PYTHON_IMAGE }}-${{ hashFiles('requirements.txt', 'requirements_dev.txt') }}
42
+
43
+ linters:
44
+ needs: setup
45
+ runs-on: ubuntu-latest
46
+
47
+ steps:
48
+ - name: Checkout code
49
+ uses: actions/checkout@v2
50
+
51
+ - name: Set up Python
52
+ uses: actions/setup-python@v3
53
+ with:
54
+ python-version: ${{ env.PYTHON_IMAGE }}
55
+
56
+ - name: Load virtual environment
57
+ uses: actions/cache@v2
58
+ with:
59
+ path: venv
60
+ key: ${{ runner.os }}-venv-${{ env.PYTHON_IMAGE }}-${{ hashFiles('requirements.txt', 'requirements_dev.txt') }}
61
+
62
+ - name: Run linters and checks
63
+ run: |
64
+ source venv/bin/activate
65
+ isort ./${{ env.PYTHON_PACKAGE_NAME }}
66
+ black ./${{ env.PYTHON_PACKAGE_NAME }}
67
+ mypy ./${{ env.PYTHON_PACKAGE_NAME }} --install-types --non-interactive --config-file pyproject.toml
68
+ env:
69
+ PIP_DISABLE_PIP_VERSION_CHECK: 1
70
+
71
+ - name: Save linter reports
72
+ if: always()
73
+ uses: actions/upload-artifact@v2
74
+ with:
75
+ name: linter-reports
76
+ path: report.xml
77
+
78
+ tests:
79
+ needs: setup
80
+ runs-on: ubuntu-latest
81
+
82
+ steps:
83
+ - name: Checkout code
84
+ uses: actions/checkout@v2
85
+
86
+ - name: Set up Python
87
+ uses: actions/setup-python@v2
88
+ with:
89
+ python-version: ${{ env.PYTHON_IMAGE }}
90
+
91
+ - name: Load virtual environment
92
+ uses: actions/cache@v2
93
+ with:
94
+ path: venv
95
+ key: ${{ runner.os }}-venv-${{ env.PYTHON_IMAGE }}-${{ hashFiles('requirements.txt', 'requirements_dev.txt') }}
96
+
97
+ - name: Run shuffled tests
98
+ run: |
99
+ source venv/bin/activate
100
+ pytest --random-order --junitxml=tests.xml
101
+ env:
102
+ PIP_DISABLE_PIP_VERSION_CHECK: 1
103
+
104
+ - name: Save test reports
105
+ if: always()
106
+ uses: actions/upload-artifact@v2
107
+ with:
108
+ name: test-reports
109
+ path: tests.xml
110
+
111
+ coverage:
112
+ needs: setup
113
+ runs-on: ubuntu-latest
114
+
115
+ steps:
116
+ - name: Checkout code
117
+ uses: actions/checkout@v2
118
+
119
+ - name: Set up Python
120
+ uses: actions/setup-python@v2
121
+ with:
122
+ python-version: ${{ env.PYTHON_IMAGE }}
123
+
124
+ - name: Load virtual environment
125
+ uses: actions/cache@v2
126
+ with:
127
+ path: venv
128
+ key: ${{ runner.os }}-venv-${{ env.PYTHON_IMAGE }}-${{ hashFiles('requirements.txt', 'requirements_dev.txt') }}
129
+
130
+ - name: Run coverage
131
+ run: |
132
+ source venv/bin/activate
133
+ coverage run -m pytest --junitxml=report.xml
134
+ coverage report
135
+ coverage xml
136
+ env:
137
+ PIP_DISABLE_PIP_VERSION_CHECK: 1
138
+
139
+ - name: Save coverage reports
140
+ if: always()
141
+ uses: actions/upload-artifact@v2
142
+ with:
143
+ name: coverage-reports
144
+ path: coverage.xml
145
+
146
+ tox_tests:
147
+ needs: setup
148
+ runs-on: ubuntu-latest
149
+ if: startsWith(github.ref, 'refs/tags/v')
150
+ container:
151
+ image: ghcr.io/openweathermap/deker/deker-embedded/tox:latest
152
+ env:
153
+ PACKAGE_VERSION: ${{ github.REF_NAME }}
154
+ credentials:
155
+ username: ${{ github.actor }}
156
+ password: ${{ secrets.GITHUB_TOKEN }}
157
+ steps:
158
+ - name: Set python versions
159
+ run: pyenv global 3.9 3.10 3.11
160
+
161
+ - name: Checkout code
162
+ uses: actions/checkout@v2
163
+ - name: Install tox
164
+ run: |
165
+ pip install tox
166
+ env:
167
+ PIP_DISABLE_PIP_VERSION_CHECK: 1
168
+ - name: Run tox tests
169
+ run: tox
170
+ env:
171
+ PIP_DISABLE_PIP_VERSION_CHECK: 1
172
+ PACKAGE_VERSION: ${{ github.REF_NAME }}
173
+
174
+ build_wheels:
175
+ name: Build wheels on ${{ matrix.os }}
176
+ needs: tox_tests
177
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
178
+ runs-on: ${{ matrix.os }}
179
+ env:
180
+ PACKAGE_VERSION: ${{ github.REF_NAME }}
181
+ strategy:
182
+ matrix:
183
+ os: [ubuntu-22.04]
184
+
185
+ steps:
186
+ - uses: actions/checkout@v3
187
+
188
+ - name: Build wheels
189
+ run: |
190
+ pip wheel -w ./wheelhouse .
191
+
192
+
193
+ build_sdist:
194
+ needs: tox_tests
195
+ env:
196
+ PACKAGE_VERSION: ${{ github.REF_NAME }}
197
+ name: Build source distribution
198
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
199
+ runs-on: ubuntu-latest
200
+ steps:
201
+ - uses: actions/checkout@v3
202
+ with:
203
+ fetch-depth: 0
204
+
205
+ - name: Build sdist
206
+ run: pipx run build --sdist
207
+
208
+ - uses: actions/upload-artifact@v3
209
+ with:
210
+ path: dist/*.tar.gz
211
+
212
+ upload_pypi:
213
+ needs: [build_wheels, build_sdist]
214
+ runs-on: ubuntu-latest
215
+ permissions:
216
+ id-token: write
217
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
218
+ environment:
219
+ name: pypi
220
+ url: https://pypi.org/p/deker-tools
221
+
222
+ steps:
223
+ - uses: actions/download-artifact@v3
224
+ with:
225
+ # unpacks default artifact into dist/
226
+ # if `name: artifact` is omitted, the action will create extra parent dir
227
+ name: artifact
228
+ path: dist
229
+
230
+ - name: Publish package distributions to PyPI
231
+ uses: pypa/gh-action-pypi-publish@release/v1
232
+
233
+
@@ -0,0 +1,150 @@
1
+ ### Python template
2
+ # Byte-compiled / optimized / DLL files
3
+ */__pycache__/
4
+ *.py[cod]
5
+ *$py.class
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ ../../../build/
13
+ develop-eggs/
14
+ ../../dist/
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
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
99
+ __pypackages__/
100
+
101
+ # Celery stuff
102
+ celerybeat-schedule
103
+ celerybeat.pid
104
+
105
+ # SageMath parsed files
106
+ *.sage.py
107
+
108
+ # Environments
109
+ .env
110
+ *.env
111
+ ../*.env
112
+ ../../*.env
113
+ .venv
114
+ env/
115
+ venv/
116
+ ENV/
117
+ ../ENV/
118
+ ../../ENV/
119
+ env.bak/
120
+ venv.bak/
121
+
122
+ # Spyder project settings
123
+ .spyderproject
124
+ .spyproject
125
+
126
+ # Rope project settings
127
+ .ropeproject
128
+
129
+ # mkdocs documentation
130
+ /site
131
+
132
+ # mypy
133
+ .mypy_cache/
134
+ .dmypy.json
135
+ dmypy.json
136
+
137
+ # Pyre type checker
138
+ .pyre/
139
+
140
+ # pytype static type analyzer
141
+ .pytype/
142
+
143
+ # Cython debug symbols
144
+ cython_debug/
145
+
146
+ # YOUR IGNORINGS HERE
147
+ .idea/
148
+ tests/code_coverage/
149
+ */tmp.py
150
+ deker_tools/tmp.py