Skip to content

fix(ci): use editable install + ignore live tests at collection - #91

Merged
cleitonleonel merged 4 commits into
cleitonleonel:masterfrom
victalejo:master
May 18, 2026
Merged

fix(ci): use editable install + ignore live tests at collection#91
cleitonleonel merged 4 commits into
cleitonleonel:masterfrom
victalejo:master

Conversation

@victalejo

Copy link
Copy Markdown
Contributor

Summary

The CI workflow added in # failed on every test job with
ModuleNotFoundError: No module named 'pyquotex'. Three root causes,
all fixed here:

  1. Build backend was broken. pyproject.toml mixed PEP 621
    [project] with legacy [tool.poetry] fields (packages = [...],
    [tool.poetry] include = ...). With poetry-core>=2.0 this combo
    fails metadata generation: tool.poetry.dependencies must be object.
    So pip install -e . couldn't work at all — neither locally nor on CI.

  2. CI never installed the package. The workflow used
    pip install -r requirements.txt, which pulls runtime deps but does
    not put pyquotex/ on sys.path. Tests imported from pyquotex.…
    and crashed at collection.

  3. Legacy live tests blocked collection. tests/test_basic.py
    (and 8 others) call credentials() at module import time, which
    does input("Enter your account email: ") when settings/config.ini
    is absent. On CI stdin is closed, so pytest aborted with
    OSError: reading from stdin while output is capturedbefore
    the live-test skip marker could fire.

Changes

  • pyproject.toml — migrated to hatchling as the build backend.
    Cleaned legacy [tool.poetry] cruft. Added test and dev
    optional-dependency extras. Kept the existing ruff/pytest config.
    Wheel still ships py.typed (verified by python -m build).

  • tests/conftest.py — added pytest_ignore_collect that drops
    the legacy live test modules from the collection phase entirely
    when PYQUOTEX_LIVE is unset. They're still discoverable / runnable
    with PYQUOTEX_LIVE=1 pytest.

  • .github/workflows/ci.yml — replaced
    pip install -r requirements.txt … with pip install -e ".[test]"
    in both the type-check and test jobs. Same change makes the
    install path the same one a downstream user would take, validating
    the package is publishable.

Test plan

Locally, from a clean venv:

python -m venv .venv && . .venv/bin/activate
pip install -e ".[test]"
ruff check pyquotex tests scripts
mypy --ignore-missing-imports --no-strict-optional \
  pyquotex/types.py pyquotex/utils/streaming_indicators.py \
  pyquotex/utils/cache.py pyquotex/utils/json_utils.py \
  pyquotex/_api/_waits.py
pytest -q --cov=pyquotex

Result on this branch:

=== RUFF ===   All checks passed!
=== MYPY ===   Success: no issues found in 5 source files
=== PYTEST === 108 passed in 2.95s  (coverage 41%)

victalejo and others added 4 commits May 15, 2026 12:05
- Removed unnecessary blank lines in various files for cleaner code.
- Reformatted import statements for consistency and readability.
- Improved comments for clarity in the expiration.py and processor.py files.
- Added shared pytest fixtures and configuration for better test organization.
- Introduced a minimal replay server for offline integration tests.
- Implemented end-to-end integration tests to validate the Quotex client against the replay server.
- Enhanced test coverage for various functionalities including connection handling, balance events, and candle retrieval.
@cleitonleonel
cleitonleonel merged commit 5e85fcb into cleitonleonel:master May 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants