Commit Graph

7 Commits

Author SHA1 Message Date
Rob Hudson ea063edf0a
Update linting configuration (#1915)
* Update linting configuration

This removes flake8 in favor of ruff, which also provides isort support, and
updates all files to be black, isort, and ruff compliant. This also adds black
and ruff checks to the tox and Github linting workflow.

* Tweak the code coverage config and calls
2023-05-17 23:19:14 +07:00
Selwin Ong 64cb1a27b9
Worker pool (#1874)
* First stab at implementating worker pool

* Use process.is_alive() to check whether a process is still live

* Handle shutdown signal

* Check worker loop done

* First working version of `WorkerPool`.

* Added test for check_workers()

* Added test for pool.start()

* Better shutdown process

* Comment out test_start() to see if it fixes CI

* Make tests pass

* Make CI pass

* Comment out some tests

* Comment out more tests

* Re-enable a test

* Re-enable another test

* Uncomment check_workers test

* Added run_worker test

* Minor modification to dead worker detection

* More test cases

* Better process name for workers

* Added back pool.stop_workers() when signal is received

* Cleaned up cli.py

* WIP on worker-pool command

* Fix test

* Test that worker pool ignores consecutive shutdown signals

* Added test for worker-pool CLI command.

* Added timeout to CI jobs

* Fix worker pool test

* Comment out test_scheduler.py

* Fixed worker-pool in burst mode

* Increase test coverage

* Exclude tests directory from coverage.py

* Improve test coverage

* Renamed `Pool(num_workers=2) to `Pool(size=2)`

* Revert "Renamed `Pool(num_workers=2) to `Pool(size=2)`"

This reverts commit a1306f89ad.

* Renamed Pool to WorkerPool

* Added a new TestCase that doesn't use LocalStack

* Added job_class, worker_class and serializer arguments to WorkerPool

* Use parse_connection() in WorkerPool.__init__

* Added CLI arguments for worker-pool

* Minor WorkerPool and test fixes

* Fixed failing CLI test

* Document WorkerPool
2023-05-01 12:44:32 +07:00
Selwin Ong 95983cfcac Exclude tests directory from coverage.py 2023-04-25 09:43:36 +07:00
Selwin Ong 60bed7d58c
Exclude tests dir from coverage.py (#1883) 2023-04-23 16:48:04 +07:00
Selwin Ong ed7a171460
Ignore `if TYPE_CHECKING:` when measuring test coverage (#1875)
* Ignore `if TYPE_CHECKING:` when measuring test coverage

* Update codecov.yml instead

* Added "[report]" to coveragerc

* Revert "Update codecov.yml instead"

This reverts commit f68a905de4.
2023-04-08 09:46:29 +07:00
Vincent Driessen 5331dc4de6 Ignore local.py (it's tested in werkzeug instead). 2014-08-14 10:19:12 +02:00
Vincent Driessen ea46e79625 Exclude vendor files and irrelevant files from coverage reports. 2014-07-25 23:22:39 +02:00