zprocess 2.25.0__tar.gz → 2.26.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 (69) hide show
  1. zprocess-2.26.0/.github/workflows/release.yml +322 -0
  2. zprocess-2.26.0/.gitignore +7 -0
  3. zprocess-2.26.0/PKG-INFO +61 -0
  4. {zprocess-2.25.0 → zprocess-2.26.0}/README.md +0 -4
  5. zprocess-2.26.0/pyproject.toml +47 -0
  6. zprocess-2.26.0/pytest.ini +26 -0
  7. {zprocess-2.25.0 → zprocess-2.26.0}/tests/test_remote.py +15 -14
  8. {zprocess-2.25.0 → zprocess-2.26.0}/tests/test_zlock_server.py +37 -44
  9. {zprocess-2.25.0 → zprocess-2.26.0}/tests/test_zlog_server.py +10 -19
  10. zprocess-2.25.0/tests/tests.py → zprocess-2.26.0/tests/test_zprocess.py +9 -22
  11. zprocess-2.26.0/zprocess/__init__.py +45 -0
  12. zprocess-2.26.0/zprocess/__version__.py +12 -0
  13. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/clientserver.py +1 -30
  14. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/cryptoproxy.py +0 -7
  15. zprocess-2.26.0/zprocess/examples/example_child.py +23 -0
  16. zprocess-2.26.0/zprocess/examples/example_parent.py +23 -0
  17. zprocess-2.26.0/zprocess/examples/processclass_example.py +20 -0
  18. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/examples/processclass_remote_example.py +1 -15
  19. zprocess-2.26.0/zprocess/makesecret.py +37 -0
  20. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/process_class_wrapper.py +10 -10
  21. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/process_tree.py +8 -33
  22. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/remote/__init__.py +5 -18
  23. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/remote/__main__.py +0 -4
  24. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/remote/server.py +2 -11
  25. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/security.py +2 -49
  26. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/socks/__init__.py +1 -9
  27. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/socks/server.py +0 -8
  28. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/tasks.py +1 -19
  29. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/utils.py +12 -25
  30. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/zlock/__init__.py +1 -25
  31. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/zlock/__main__.py +1 -19
  32. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/zlock/server.py +1 -11
  33. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/zlog/__init__.py +2 -21
  34. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/zlog/__main__.py +1 -19
  35. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/zlog/server.py +0 -5
  36. zprocess-2.26.0/zprocess.egg-info/PKG-INFO +61 -0
  37. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess.egg-info/SOURCES.txt +2 -5
  38. zprocess-2.26.0/zprocess.egg-info/requires.txt +10 -0
  39. zprocess-2.25.0/.coveragerc +0 -27
  40. zprocess-2.25.0/.github/workflows/release.yml +0 -256
  41. zprocess-2.25.0/.gitignore +0 -10
  42. zprocess-2.25.0/.travis.yml +0 -21
  43. zprocess-2.25.0/PKG-INFO +0 -39
  44. zprocess-2.25.0/pyproject.toml +0 -3
  45. zprocess-2.25.0/setup.py +0 -37
  46. zprocess-2.25.0/zprocess/__init__.py +0 -98
  47. zprocess-2.25.0/zprocess/__version__.py +0 -21
  48. zprocess-2.25.0/zprocess/examples/example_child.py +0 -36
  49. zprocess-2.25.0/zprocess/examples/example_parent.py +0 -37
  50. zprocess-2.25.0/zprocess/examples/processclass_example.py +0 -34
  51. zprocess-2.25.0/zprocess/makesecret.py +0 -56
  52. zprocess-2.25.0/zprocess.egg-info/PKG-INFO +0 -39
  53. zprocess-2.25.0/zprocess.egg-info/not-zip-safe +0 -1
  54. zprocess-2.25.0/zprocess.egg-info/requires.txt +0 -15
  55. {zprocess-2.25.0 → zprocess-2.26.0}/LICENSE.txt +0 -0
  56. {zprocess-2.25.0 → zprocess-2.26.0}/doc/Makefile +0 -0
  57. {zprocess-2.25.0 → zprocess-2.26.0}/doc/conf.py +0 -0
  58. {zprocess-2.25.0 → zprocess-2.26.0}/doc/index.rst +0 -0
  59. {zprocess-2.25.0 → zprocess-2.26.0}/doc/requirements.txt +0 -0
  60. {zprocess-2.25.0 → zprocess-2.26.0}/requirements.txt +0 -0
  61. {zprocess-2.25.0 → zprocess-2.26.0}/run_tests.py +0 -0
  62. {zprocess-2.25.0 → zprocess-2.26.0}/setup.cfg +0 -0
  63. {zprocess-2.25.0 → zprocess-2.26.0}/tests/GUI_output_redirection.py +0 -0
  64. {zprocess-2.25.0 → zprocess-2.26.0}/tests/output_redirection.py +0 -0
  65. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/locking/__init__.py +0 -0
  66. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/locking/__main__.py +0 -0
  67. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess/remote/curses_server.py +0 -0
  68. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess.egg-info/dependency_links.txt +0 -0
  69. {zprocess-2.25.0 → zprocess-2.26.0}/zprocess.egg-info/top_level.txt +0 -0
@@ -0,0 +1,322 @@
1
+ name: Build and Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ tags:
8
+ - 'v[0-9]+.[0-9]+.[0-9]+*'
9
+
10
+ env:
11
+ OS_LIST_UBUNTU: '["ubuntu-latest"]'
12
+ OS_LIST_ALL: '["ubuntu-latest", "windows-latest", "macos-latest", "macos-13"]'
13
+
14
+
15
+ jobs:
16
+ configure:
17
+ name: Configure workflow run
18
+ runs-on: ubuntu-latest
19
+ outputs:
20
+ PYTHONS: ${{ steps.config.outputs.PYTHONS }}
21
+ DEFAULTPYTHON: ${{ steps.config.outputs.DEFAULTPYTHON }}
22
+ CIBW_BUILD: ${{ steps.config.outputs.CIBW_BUILD }}
23
+ PKGNAME: ${{ steps.config.outputs.PKGNAME }}
24
+ PKGVER: ${{ steps.config.outputs.PKGVER }}
25
+ PURE: ${{ steps.config.outputs.PURE }}
26
+ CONDA_BUILD_ARGS: ${{ steps.config.outputs.CONDA_BUILD_ARGS }}
27
+ BUILD_OS_LIST: ${{ steps.config.outputs.BUILD_OS_LIST }}
28
+ RELEASE: ${{ steps.config.outputs.RELEASE }}
29
+ TESTPYPI_UPLOAD: ${{ steps.config.outputs.TESTPYPI_UPLOAD }}
30
+ PYPI_UPLOAD: ${{ steps.config.outputs.PYPI_UPLOAD }}
31
+ TEST_ANACONDA_UPLOAD: ${{ steps.config.outputs.TEST_ANACONDA_UPLOAD }}
32
+ ANACONDA_UPLOAD: ${{ steps.config.outputs.ANACONDA_UPLOAD }}
33
+
34
+ steps:
35
+ - name: Checkout
36
+ uses: actions/checkout@v4
37
+ with:
38
+ fetch-depth: 0
39
+
40
+ - name: Install Python
41
+ uses: actions/setup-python@v5
42
+ with:
43
+ python-version: '3.x'
44
+
45
+ - name: Configure workflow
46
+ id: config
47
+ run: |
48
+ pip install ci-helper
49
+
50
+ # Second-most recent supported Python version:
51
+ DEFAULTPYTHON=$(ci-helper defaultpython)
52
+
53
+ # All supported Python versions:
54
+ PYTHONS=$(ci-helper pythons)
55
+
56
+ # Env var for `cibuildwheel` to build for all supported CPython versions:
57
+ CIBW_BUILD=$(ci-helper pythons --cibw)
58
+
59
+ # Package name and version:
60
+ PKGNAME=$(ci-helper distinfo name .)
61
+ PKGVER=$(ci-helper distinfo version .)
62
+
63
+ # Whether the package is pure python, and whether its requirements depend
64
+ # on platform or Python version:
65
+ PURE=$(ci-helper distinfo is_pure .)
66
+ HAS_ENV_MARKERS=$(ci-helper distinfo has_env_markers .)
67
+
68
+ # List of OSs we need to run the build job on, and Python versions conda-build
69
+ # should target:
70
+ if [[ $PURE == false || $HAS_ENV_MARKERS == true ]]; then
71
+ BUILD_OS_LIST=$OS_LIST_ALL
72
+ CONDA_BUILD_ARGS="--pythons=$PYTHONS"
73
+ else
74
+ BUILD_OS_LIST=$OS_LIST_UBUNTU
75
+ CONDA_BUILD_ARGS="--noarch"
76
+ fi
77
+
78
+ # Release if a tag was pushed:
79
+ if [ ${{ contains(github.ref, '/tags') }} == true ]; then
80
+ RELEASE=true
81
+ else
82
+ RELEASE=false
83
+ fi
84
+
85
+ # What upload credentials is the repo configured with?
86
+ if [ '${{ secrets.TESTPYPI }}' != '' ]; then
87
+ HAVE_TESTPYPI_TOKEN=true
88
+ else
89
+ HAVE_TESTPYPI_TOKEN=false
90
+ fi
91
+ if [ '${{ secrets.PYPI }}' != '' ]; then
92
+ HAVE_PYPI_TOKEN=true
93
+ else
94
+ HAVE_PYPI_TOKEN=false
95
+ fi
96
+ if [ '${{ secrets.ANACONDA_API_TOKEN }}' != '' ]; then
97
+ HAVE_ANACONDA_TOKEN=true
98
+ else
99
+ HAVE_ANACONDA_TOKEN=false
100
+ fi
101
+ if [ '${{ vars.ANACONDA_USER }}' != '' ]; then
102
+ HAVE_ANACONDA_USER=true
103
+ else
104
+ HAVE_ANACONDA_USER=false
105
+ fi
106
+
107
+ if [ $HAVE_ANACONDA_TOKEN != $HAVE_ANACONDA_TOKEN ]; then
108
+ echo "Require both vars.ANACONDA_USER and secrets.ANACONDA_API_TOKEN"
109
+ exit 1
110
+ fi
111
+
112
+ # Upload releases to PyPI and Anaconda if the repo has creds:
113
+ if [[ $RELEASE == true && $HAVE_PYPI_TOKEN == true ]]; then
114
+ PYPI_UPLOAD=true
115
+ else
116
+ PYPI_UPLOAD=false
117
+ fi
118
+ if [[ $RELEASE == true && $HAVE_ANACONDA_TOKEN == true ]]; then
119
+ ANACONDA_UPLOAD=true
120
+ else
121
+ ANACONDA_UPLOAD=false
122
+ fi
123
+
124
+ # Upload non-releases to TestPyPI and Anaconda test label if repo has creds:
125
+ if [[ $RELEASE == false && $HAVE_TESTPYPI_TOKEN == true ]]; then
126
+ TESTPYPI_UPLOAD=true
127
+ else
128
+ TESTPYPI_UPLOAD=false
129
+ fi
130
+ if [[ $RELEASE == false && $HAVE_ANACONDA_TOKEN == true ]]; then
131
+ TEST_ANACONDA_UPLOAD=true
132
+ else
133
+ TEST_ANACONDA_UPLOAD=false
134
+ fi
135
+
136
+ echo "DEFAULTPYTHON=$DEFAULTPYTHON" >> $GITHUB_OUTPUT
137
+ echo "CIBW_BUILD=$CIBW_BUILD" >> $GITHUB_OUTPUT
138
+ echo "PKGNAME=$PKGNAME" >> $GITHUB_OUTPUT
139
+ echo "PKGVER=$PKGVER" >> $GITHUB_OUTPUT
140
+ echo "PURE=$PURE" >> $GITHUB_OUTPUT
141
+ echo "CONDA_BUILD_ARGS=$CONDA_BUILD_ARGS" >> $GITHUB_OUTPUT
142
+ echo "BUILD_OS_LIST=$BUILD_OS_LIST" >> $GITHUB_OUTPUT
143
+ echo "RELEASE=$RELEASE" >> $GITHUB_OUTPUT
144
+ echo "TESTPYPI_UPLOAD=$TESTPYPI_UPLOAD" >> $GITHUB_OUTPUT
145
+ echo "PYPI_UPLOAD=$PYPI_UPLOAD" >> $GITHUB_OUTPUT
146
+ echo "TEST_ANACONDA_UPLOAD=$TEST_ANACONDA_UPLOAD" >> $GITHUB_OUTPUT
147
+ echo "ANACONDA_UPLOAD=$ANACONDA_UPLOAD" >> $GITHUB_OUTPUT
148
+
149
+ echo
150
+ echo "======================="
151
+ echo "Workflow configuration:"
152
+ echo "-----------------------"
153
+ cat $GITHUB_OUTPUT
154
+ echo "======================="
155
+ echo
156
+
157
+
158
+ build:
159
+ name: Build
160
+ needs: configure
161
+ runs-on: ${{ matrix.os }}
162
+ strategy:
163
+ matrix:
164
+ os: ${{ fromJSON(needs.configure.outputs.BUILD_OS_LIST) }}
165
+
166
+ env:
167
+ PYTHONS: ${{ needs.configure.outputs.PYTHONS }}
168
+ DEFAULTPYTHON: ${{ needs.configure.outputs.DEFAULTPYTHON }}
169
+ CIBW_BUILD: ${{ needs.configure.outputs.CIBW_BUILD }}
170
+ PURE: ${{ needs.configure.outputs.PURE }}
171
+ CONDA_BUILD_ARGS: ${{ needs.configure.outputs.CONDA_BUILD_ARGS }}
172
+
173
+ steps:
174
+ - name: Checkout
175
+ uses: actions/checkout@v4
176
+ with:
177
+ fetch-depth: 0
178
+
179
+ - name: Install Python
180
+ uses: actions/setup-python@v5
181
+ with:
182
+ python-version: ${{ env.DEFAULTPYTHON }}
183
+
184
+ - name: Install Python tools
185
+ run: python -m pip install --upgrade pip setuptools wheel build cibuildwheel
186
+
187
+ - name: Source distribution
188
+ if: strategy.job-index == 0
189
+ run: python -m build -s .
190
+
191
+ - name: Wheel distribution (pure)
192
+ if: env.PURE == 'true' && strategy.job-index == 0
193
+ run: python -m build -w .
194
+
195
+ - name: Wheel distribution (impure)
196
+ if: env.PURE == 'false'
197
+ run: cibuildwheel --output-dir dist
198
+
199
+ - name: Upload artifact
200
+ if: env.PURE == 'false' || strategy.job-index == 0
201
+ uses: actions/upload-artifact@v4
202
+ with:
203
+ name: dist-${{ matrix.os }}
204
+ path: ./dist
205
+ if-no-files-found: error
206
+
207
+ - name: Install Miniforge
208
+ uses: conda-incubator/setup-miniconda@v3
209
+ with:
210
+ miniforge-version: "latest"
211
+ auto-update-conda: true
212
+ conda-remove-defaults: true
213
+ auto-activate-base: true
214
+ activate-environment: ""
215
+
216
+ - name: Conda package
217
+ shell: bash -l {0}
218
+ run: |
219
+ if [ ${{ runner.os }} == Windows ]; then
220
+ # Short path to minimise odds of hitting Windows max path length
221
+ CONDA_BUILD_ARGS+=" --croot ${{ runner.temp }}\cb"
222
+ fi
223
+ conda install -c labscript-suite setuptools-conda
224
+ setuptools-conda build $CONDA_BUILD_ARGS .
225
+
226
+ - name: Upload artifact
227
+ uses: actions/upload-artifact@v4
228
+ with:
229
+ name: conda_packages-${{ matrix.os }}
230
+ path: ./conda_packages
231
+ if-no-files-found: error
232
+
233
+ release:
234
+ name: Release
235
+ runs-on: ubuntu-latest
236
+ needs: [configure, build]
237
+ env:
238
+ PKGNAME: ${{ needs.configure.outputs.PKGNAME }}
239
+ PKGVER: ${{ needs.configure.outputs.PKGVER }}
240
+ RELEASE: ${{ needs.configure.outputs.RELEASE }}
241
+ TESTPYPI_UPLOAD: ${{ needs.configure.outputs.TESTPYPI_UPLOAD }}
242
+ PYPI_UPLOAD: ${{ needs.configure.outputs.PYPI_UPLOAD }}
243
+ TEST_ANACONDA_UPLOAD: ${{ needs.configure.outputs.TEST_ANACONDA_UPLOAD }}
244
+ ANACONDA_UPLOAD: ${{ needs.configure.outputs.ANACONDA_UPLOAD }}
245
+
246
+ steps:
247
+ - name: Download Artifact
248
+ uses: actions/download-artifact@v4
249
+ with:
250
+ pattern: dist*
251
+ path: ./dist
252
+ merge-multiple: true
253
+
254
+ - name: Download Artifact
255
+ uses: actions/download-artifact@v4
256
+ with:
257
+ pattern: conda_packages-*
258
+ path: ./conda_packages
259
+ merge-multiple: true
260
+
261
+ - name: Create GitHub Release and Upload Release Asset
262
+ if: env.RELEASE == 'true'
263
+ uses: softprops/action-gh-release@v2
264
+ env:
265
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
266
+ with:
267
+ tag_name: ${{ github.event.ref }}
268
+ name: ${{ env.PKGNAME }} ${{ env.PKGVER }}
269
+ draft: true
270
+ prerelease: ${{ contains(github.event.ref, 'rc') }}
271
+ files: ./dist/${{ env.PKGNAME }}-${{ env.PKGVER }}.tar.gz
272
+
273
+ - name: Publish on TestPyPI
274
+ if: env.TESTPYPI_UPLOAD == 'true'
275
+ uses: pypa/gh-action-pypi-publish@release/v1
276
+ with:
277
+ user: __token__
278
+ password: ${{ secrets.TESTPYPI }}
279
+ repository-url: https://test.pypi.org/legacy/
280
+
281
+ - name: Publish on PyPI
282
+ if: env.PYPI_UPLOAD == 'true'
283
+ uses: pypa/gh-action-pypi-publish@release/v1
284
+ with:
285
+ user: __token__
286
+ password: ${{ secrets.PYPI }}
287
+
288
+ - name: Install Miniforge
289
+ uses: conda-incubator/setup-miniconda@v3
290
+ with:
291
+ miniforge-version: "latest"
292
+ auto-update-conda: true
293
+ conda-remove-defaults: true
294
+ auto-activate-base: true
295
+ activate-environment: ""
296
+
297
+ - name: Install Anaconda cloud client
298
+ shell: bash -l {0}
299
+ run: conda install anaconda-client
300
+
301
+ - name: Publish to Anaconda test label
302
+ if: env.TEST_ANACONDA_UPLOAD == 'true'
303
+ shell: bash -l {0}
304
+ run: |
305
+ anaconda \
306
+ --token ${{ secrets.ANACONDA_API_TOKEN }} \
307
+ upload \
308
+ --skip-existing \
309
+ --user ${{ vars.ANACONDA_USER }} \
310
+ --label test \
311
+ conda_packages/*/*
312
+
313
+ - name: Publish to Anaconda main label
314
+ if: env.ANACONDA_UPLOAD == 'true'
315
+ shell: bash -l {0}
316
+ run: |
317
+ anaconda \
318
+ --token ${{ secrets.ANACONDA_API_TOKEN }} \
319
+ upload \
320
+ --skip-existing \
321
+ --user ${{ vars.ANACONDA_USER }} \
322
+ conda_packages/*/*
@@ -0,0 +1,7 @@
1
+ .coverage*
2
+ __pycache__/
3
+ dist/
4
+ *.egg-info/
5
+ build/*
6
+ conda_build/*
7
+ conda_packages/*
@@ -0,0 +1,61 @@
1
+ Metadata-Version: 2.1
2
+ Name: zprocess
3
+ Version: 2.26.0
4
+ Summary: A set of utilities for multiprocessing using zeromq
5
+ Author-email: Christopher Billington <chrisjbillington@gmail.com>
6
+ License: Copyright (c) 2013, Christopher Billington
7
+ All rights reserved.
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are met:
11
+
12
+ 1. Redistributions of source code must retain the above copyright notice, this
13
+ list of conditions and the following disclaimer.
14
+ 2. Redistributions in binary form must reproduce the above copyright notice,
15
+ this list of conditions and the following disclaimer in the documentation
16
+ and/or other materials provided with the distribution.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+
29
+ Project-URL: Homepage, https://github.com/chrisjbillington/zprocess
30
+ Project-URL: Documentation, https://github.com/chrisjbillington/zprocess
31
+ Project-URL: Repository, https://github.com/chrisjbillington/zprocess
32
+ Project-URL: Downloads, https://pypi.org/project/zprocess/
33
+ Project-URL: Tracker, https://github.com/chrisjbillington/zprocess/issues
34
+ Keywords: multiprocessing,IPC,zeromq
35
+ Classifier: License :: OSI Approved :: BSD License
36
+ Classifier: Programming Language :: Python :: 3 :: Only
37
+ Requires-Python: >=3.9
38
+ Description-Content-Type: text/markdown
39
+ License-File: LICENSE.txt
40
+ Requires-Dist: setuptools_scm
41
+ Requires-Dist: pyzmq
42
+ Requires-Dist: pywin32; sys_platform == "win32"
43
+ Requires-Dist: windows-curses; sys_platform == "win32"
44
+ Provides-Extra: test
45
+ Requires-Dist: pytest; extra == "test"
46
+ Requires-Dist: pytest-cov; extra == "test"
47
+
48
+ # zprocess
49
+
50
+ A set of utilities for multiprocessing using
51
+ zeromq. Includes process creation and management, output
52
+ redirection, message passing, inter-process locks, logging,
53
+ and a process-tree-wide event system.
54
+
55
+ (
56
+ [view on pypi](https://pypi.python.org/pypi/zprocess/);
57
+ [view on Github](https://github.com/chrisjbillington/zprocess)
58
+ )
59
+
60
+ * Install `python setup.py install`.
61
+
@@ -1,9 +1,5 @@
1
1
  # zprocess
2
2
 
3
- [![Build Status](https://travis-ci.com/chrisjbillington/zprocess.svg?branch=master)](https://travis-ci.com/chrisjbillington/zprocess)
4
-
5
- [![codecov](https://codecov.io/gh/chrisjbillington/zprocess/branch/master/graph/badge.svg)](https://codecov.io/gh/chrisjbillington/zprocess)
6
-
7
3
  A set of utilities for multiprocessing using
8
4
  zeromq. Includes process creation and management, output
9
5
  redirection, message passing, inter-process locks, logging,
@@ -0,0 +1,47 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel", "setuptools_scm"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [tool.setuptools_scm]
6
+ local_scheme = "no-local-version"
7
+
8
+ [tool.setuptools.packages]
9
+ find = {namespaces = false}
10
+
11
+ [project]
12
+ name = "zprocess"
13
+ description = "A set of utilities for multiprocessing using zeromq"
14
+ authors = [
15
+ {name = "Christopher Billington", email = "chrisjbillington@gmail.com"},
16
+ ]
17
+ keywords = ["multiprocessing", "IPC", "zeromq"]
18
+ license = {file = 'LICENSE.txt'}
19
+ classifiers = [
20
+ "License :: OSI Approved :: BSD License",
21
+ "Programming Language :: Python :: 3 :: Only",
22
+ ]
23
+ requires-python = ">=3.9"
24
+ dependencies = [
25
+ "setuptools_scm",
26
+ "pyzmq",
27
+ "pywin32; sys_platform == 'win32'",
28
+ "windows-curses; sys_platform == 'win32'",
29
+ ]
30
+ dynamic = ["version"]
31
+
32
+ [project.readme]
33
+ file = "README.md"
34
+ content-type = "text/markdown"
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/chrisjbillington/zprocess"
38
+ Documentation = "https://github.com/chrisjbillington/zprocess"
39
+ Repository = "https://github.com/chrisjbillington/zprocess"
40
+ Downloads = "https://pypi.org/project/zprocess/"
41
+ Tracker = "https://github.com/chrisjbillington/zprocess/issues"
42
+
43
+ [project.optional-dependencies]
44
+ test = [
45
+ "pytest",
46
+ "pytest-cov",
47
+ ]
@@ -0,0 +1,26 @@
1
+ [pytest]
2
+ testpaths = tests
3
+ python_files = test_*.py
4
+ python_classes = *Tests
5
+ python_functions = test_*
6
+
7
+ # Configure logging
8
+ log_cli = true
9
+ log_cli_level = INFO
10
+
11
+ # Configure test collection
12
+ norecursedirs = .* build dist *.egg
13
+
14
+ # Configure coverage
15
+ addopts =
16
+ --verbosity=2
17
+ --cov=zprocess
18
+ --cov-report=term-missing
19
+ --cov-report=html
20
+ --cov-config=pyproject.toml
21
+
22
+ # Configure markers
23
+ markers =
24
+ slow: marks tests as slow
25
+ integration: marks tests as integration tests
26
+ no_ci: marks tests that shouldn't run in CI
@@ -1,14 +1,14 @@
1
- from __future__ import unicode_literals, print_function, division
2
1
  import sys
3
- PY2 = sys.version_info.major == 2
4
- if PY2:
5
- str = unicode
6
- import os
2
+ from pathlib import Path
7
3
  import unittest
8
- import xmlrunner
4
+ import pytest
9
5
 
10
- parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
11
- sys.path.insert(0, parent_dir)
6
+ THIS_DIR = Path(__file__).absolute().parent
7
+
8
+ # Add project root to import path
9
+ PROJECT_ROOT = THIS_DIR.parent
10
+ if PROJECT_ROOT not in [Path(s).absolute() for s in sys.path]:
11
+ sys.path.insert(0, str(PROJECT_ROOT))
12
12
 
13
13
  from zprocess.remote.server import RemoteProcessServer
14
14
  from zprocess.remote import RemoteProcessClient, PROTOCOL_VERSION
@@ -44,14 +44,15 @@ class ZprocessRemoteTests(unittest.TestCase):
44
44
  self.assertEqual(result, PROTOCOL_VERSION)
45
45
 
46
46
  def test_basic_process(self):
47
- proc = TestProcess(self.process_tree, remote_process_client=self.client)
47
+ proc = Process(
48
+ self.process_tree,
49
+ remote_process_client=self.client,
50
+ # Give by import path relative to zprocess project directory where tests are running from
51
+ subclass_fullname='tests.test_remote.TestProcess',
52
+ )
48
53
  to_child, from_child = proc.start()
49
54
  to_child.put('hello')
50
55
  self.assertEqual(from_child.get(), 'hello')
51
56
 
52
57
  if __name__ == '__main__':
53
- output = 'test-reports'
54
- if PY2:
55
- output = output.encode('utf8')
56
- testRunner = xmlrunner.XMLTestRunner(output=output, verbosity=3)
57
- unittest.main(verbosity=3, testRunner=testRunner, exit=not sys.flags.interactive)
58
+ pytest.main([__file__, '-v'])
@@ -1,17 +1,17 @@
1
- from __future__ import unicode_literals, print_function, division
2
1
  import sys
3
- import os
2
+ from pathlib import Path
4
3
  import time
5
4
  import zmq
6
5
  import unittest
7
- import xmlrunner
8
6
 
9
- PY2 = sys.version_info.major == 2
10
- if PY2:
11
- str = unicode
7
+ import pytest
12
8
 
13
- parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
14
- sys.path.insert(0, parent_dir)
9
+ THIS_DIR = Path(__file__).absolute().parent
10
+
11
+ # Add project root to import path
12
+ PROJECT_ROOT = THIS_DIR.parent
13
+ if PROJECT_ROOT not in [Path(s).absolute() for s in sys.path]:
14
+ sys.path.insert(0, str(PROJECT_ROOT))
15
15
 
16
16
  from zprocess.zlock.server import (
17
17
  ZMQLockServer,
@@ -712,42 +712,35 @@ class OtherTests(unittest.TestCase):
712
712
  server.stop()
713
713
 
714
714
 
715
- def test_speed():
716
- with Client(None, 7339, b'key_foo', b'client_foo') as client:
717
- start_time = time.time()
718
- client.send(b'hello')
719
- assert client.recv() == b'hello'
720
- for _ in range(1000):
721
- client.send(b'hello')
722
- assert client.recv() == b'hello'
723
- print('hello:', (time.time() - start_time) / 1000 * 1e6, 'us')
724
-
725
- start_time = time.time()
726
- for _ in range(1000):
727
- client.send_multipart([b'acquire', b'foo', b'client_foo', b'30'])
728
- assert client.recv() == b'ok'
729
- client.send_multipart([b'release', b'foo', b'client_foo'])
730
- assert client.recv() == b'ok'
731
- print('acq/release:', (time.time() - start_time) / 1000 * 1e6, 'us')
732
-
733
- start_time = time.time()
734
- for _ in range(1000):
735
- with open('/etc/hosts'):
736
- pass
737
- print('open/close:', (time.time() - start_time) / 1000 * 1e6, 'us')
715
+ # def test_speed():
716
+ # with Client(None, 7339, b'key_foo', b'client_foo') as client:
717
+ # start_time = time.time()
718
+ # client.send(b'hello')
719
+ # assert client.recv() == b'hello'
720
+ # for _ in range(1000):
721
+ # client.send(b'hello')
722
+ # assert client.recv() == b'hello'
723
+ # print('hello:', (time.time() - start_time) / 1000 * 1e6, 'us')
724
+
725
+ # start_time = time.time()
726
+ # for _ in range(1000):
727
+ # client.send_multipart([b'acquire', b'foo', b'client_foo', b'30'])
728
+ # assert client.recv() == b'ok'
729
+ # client.send_multipart([b'release', b'foo', b'client_foo'])
730
+ # assert client.recv() == b'ok'
731
+ # print('acq/release:', (time.time() - start_time) / 1000 * 1e6, 'us')
732
+
733
+ # start_time = time.time()
734
+ # for _ in range(1000):
735
+ # with open('/etc/hosts'):
736
+ # pass
737
+ # print('open/close:', (time.time() - start_time) / 1000 * 1e6, 'us')
738
+
739
+ # start_time = time.time()
740
+ # for _ in range(1000):
741
+ # pass
742
+ # print('nothing:', (time.time() - start_time) / 1000 * 1e6, 'us')
738
743
 
739
- start_time = time.time()
740
- for _ in range(1000):
741
- pass
742
- print('nothing:', (time.time() - start_time) / 1000 * 1e6, 'us')
743
-
744
-
745
- # test_speed()
746
744
 
747
745
  if __name__ == '__main__':
748
-
749
- output = 'test-reports'
750
- if PY2:
751
- output = output.encode('utf8')
752
- testRunner = xmlrunner.XMLTestRunner(output=output, verbosity=3)
753
- unittest.main(verbosity=3, testRunner=testRunner, exit=not sys.flags.interactive)
746
+ pytest.main([__file__, '-v'])
@@ -1,20 +1,18 @@
1
- from __future__ import unicode_literals, print_function, division
2
1
  import sys
2
+ from pathlib import Path
3
3
  import os
4
4
  import uuid
5
5
  import shutil
6
6
  import zmq
7
7
  import unittest
8
- import xmlrunner
8
+ import pytest
9
9
 
10
- PY2 = sys.version_info.major == 2
11
- if PY2:
12
- str = unicode
10
+ THIS_DIR = Path(__file__).absolute().parent
13
11
 
14
- parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
15
- sys.path.insert(0, parent_dir)
16
-
17
- BITBUCKET = os.getenv('CI', None) is not None
12
+ # Add project root to import path
13
+ PROJECT_ROOT = THIS_DIR.parent
14
+ if PROJECT_ROOT not in [Path(s).absolute() for s in sys.path]:
15
+ sys.path.insert(0, str(PROJECT_ROOT))
18
16
 
19
17
  from zprocess.zlog.server import (
20
18
  ZMQLogServer,
@@ -131,16 +129,13 @@ class ZLogServerTests(unittest.TestCase):
131
129
  client.send_multipart([b'check_access', b'\xff'])
132
130
  client.assertReceived(ERR_BAD_ENCODING)
133
131
 
134
- # The following two tests fail on Bitbucket pipelines, because for some reason
135
- # creating and accessing files always succeeds in the CI environment even if there
136
- # are insufficient permissions.
137
- @unittest.skipIf(BITBUCKET or os.name == 'nt', 'Skip on Windows and BitBucket')
132
+ @pytest.mark.skipif(os.name == 'nt', reason='Skip on Windows')
138
133
  def test_no_access(self):
139
134
  with self.client(None) as client:
140
135
  client.send_multipart([b'check_access', b'/test.log'])
141
136
  self.assertIn(b'[Errno 13] Permission denied', client.recv())
142
137
 
143
- @unittest.skipIf(BITBUCKET or os.name == 'nt', 'Skip on Windows and BitBucket')
138
+ @pytest.mark.skipif(os.name == 'nt', reason='Skip on Windows')
144
139
  def test_cant_create_files(self):
145
140
  os.mkdir('testdir')
146
141
  os.system('touch testdir/foo.log')
@@ -178,8 +173,4 @@ class ZLogServerTests(unittest.TestCase):
178
173
  self.assertEqual(f.read(), msg + '\n')
179
174
 
180
175
  if __name__ == '__main__':
181
- output = 'test-reports'
182
- if PY2:
183
- output = output.encode('utf8')
184
- testRunner = xmlrunner.XMLTestRunner(output=output, verbosity=3)
185
- unittest.main(verbosity=3, testRunner=testRunner, exit=not sys.flags.interactive)
176
+ pytest.main([__file__, '-v'])