• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

geopython / pywps / 5487252648

pending completion
5487252648

push

github

web-flow
Support Python3.10/3.11, documentation fixes, and general codebase cleanup (#677)

* docstring adjustments, removal of unused imports, renaming of internal variables accoing to PEP8 conventions, update URL targets

* remove references to Travis-CI, formatting adjustments

* standardize requirements for readability

* Mention support for Python3.10 and Python3.11

* Add Zeitsperre to CONTRIBUTORS.md

* update installation instructions to reflect modern python approaches and changes to GitHub repository

* Add CI builds for Python3.10 and Python3.11

* remove unused imports

* undo regression

* silence DeprecationWarning for newer sqlalchemy

* fix bad installation command

* cleanup docstrings, remove unused imports

* update actions versions

* ran "isort --py 37 --profile black"

---------

Co-authored-by: MacPingu <cehbrecht@users.noreply.github.com>

160 of 160 new or added lines in 31 files covered. (100.0%)

5106 of 6278 relevant lines covered (81.33%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/pywps/processing/basic.py
1
##################################################################
2
# Copyright 2018 Open Source Geospatial Foundation and others    #
3
# licensed under MIT, Please consult LICENSE.txt for details     #
4
##################################################################
5
import os
1✔
6

7
from pywps.processing.job import Job
1✔
8

9

10
class Processing(object):
1✔
11
    """
12
    :class:`Processing` is an interface for running jobs.
13
    """
14

15
    def __init__(self, process, wps_request, wps_response):
1✔
16
        self.job = Job(process, wps_request, wps_response)
1✔
17

18
    def start(self):
1✔
19
        raise NotImplementedError("Needs to be implemented in subclass.")
×
20

21
    def cancel(self):
1✔
22
        raise NotImplementedError("Needs to be implemented in subclass.")
×
23

24

25
class MultiProcessing(Processing):
1✔
26
    """
27
    :class:`MultiProcessing` is the default implementation to run jobs using the
28
    :module:`multiprocessing` module.
29
    """
30

31
    def start(self):
1✔
32
        import multiprocessing
1✔
33
        process = multiprocessing.Process(
1✔
34
            target=getattr(self.job.process, self.job.method),
35
            args=(self.job.wps_request, self.job.wps_response)
36
        )
37
        process.start()
1✔
38

39

40
class DetachProcessing(Processing):
1✔
41
    """
42
    :class:`DetachProcessing` run job as detached process. The process will be run as child of pid 1
43
    """
44

45
    def start(self):
1✔
46
        pid = os.fork()
×
47
        if pid != 0:
×
48
            # Wait that the children get detached.
49
            os.waitpid(pid, 0)
×
50
            return
×
51

52
        # Detach ourself.
53

54
        # Ensure that we are the session leader to avoid to be zombified.
55
        os.setsid()
×
56
        if os.fork():
×
57
            # Stop running now
58
            os._exit(0)
×
59

60
        # We are the detached child, run the actual process
61
        try:
×
62
            getattr(self.job.process, self.job.method)(self.job.wps_request, self.job.wps_response)
×
63
        except Exception:
×
64
            pass
×
65
        # Ensure to stop ourself here what ever append.
66
        os._exit(0)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc