Repository navigation
Prepare 0.2.0 for PyPI: self-contained sdist, settled public API, Trusted Publishing release workflow - #3
Merged
Conversation
- DXTradeClient is the class; DXTradeDashboardWrapper stays as an alias. - DXTradeConnectionError is the network-error class. The 0.1 name ConnectionError still imports but is no longer in __all__: after `from dxtrade_wrapper import *`, `except ConnectionError` stopped catching socket errors such as ConnectionRefusedError (verified). - logout() closes the requests Session before replacing it, so a bot that re-logs in for days does not leak one connection pool per session. - tests/test_public_api.py pins these; 5 of its 6 tests fail on the old code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kflow - MANIFEST.in: the sdist shipped tests/test_*.py without conftest.py or the JSON fixtures, so `pytest` in an unpacked sdist failed with 7 collection errors. It now also includes CHANGELOG, examples and scripts. - pyproject: Python 3.9-3.14 and OS classifiers; Source, Issues and Changelog URLs. - README: an Install section, absolute links (relative ones break on PyPI), accurate 401/403 wording, packaging and release notes. - scripts/check_release.py: the version has a CHANGELOG entry; with a tag, the tag matches __version__ and the entry is dated. CHANGELOG dates 0.2.0. - CI package job: check_release, twine check --strict, test the unpacked sdist, install the wheel in a clean venv and check py.typed. - release.yml (on a published GitHub release): build and check, attach the sdist and wheel to the release, then publish to TestPyPI and PyPI via Trusted Publishing, only when the repository variable PYPI_PUBLISH=true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares 0.2.0 for a first PyPI release: fixes the sdist, settles two public names that become breaking changes once published, and adds a release workflow that publishes through PyPI Trusted Publishing. Nothing is published by this PR.
Why
tests/test*.py. With noconftest.pyand notests/fixtures/*.json,pytestin an unpacked sdist stopped with 7 collection errors, which breaks downstream packagers.from dxtrade_wrapper import *replaced the builtinConnectionError. After a star import,except ConnectionErrorno longer caught socket errors such asConnectionRefusedError; I checked this directly. Renames like this cost a deprecation cycle once a release is public.DXTradeDashboardWrapper, withDXTradeClientonly an alias.logout()dropped itsrequests.Sessionwithout closing it, leaking one connection pool per re-login in long-running bots.AuthenticationErrorcovers "401/403", which is true only at login.What changed
API:
DXTradeClientis the class, andDXTradeDashboardWrapperremains as an alias.DXTradeConnectionErroris the network-error class.ConnectionErrorstill imports, as the same class, but is no longer in__all__.logout()closes the Session before replacing it.Packaging:
MANIFEST.inadds the tests and fixtures, CHANGELOG, examples and scripts.pyproject.tomlgains classifiers for Python 3.9–3.14 and the OS, and the extra URLs.README:
DXTradeAPIError;scripts/check_release.py: the version has a CHANGELOG entry. Given a tag, it also checks that the tag equals__version__and that the entry is dated. CHANGELOG now reads0.2.0 (2026-10-01)and records the API changes above.CI
packagejob:check_release.py,twine check --strict, running the unpacked sdist's own tests, and installing the wheel in a clean venv with apy.typedcheck..github/workflows/release.yml, triggered when a GitHub release is published:skip-existing), then PyPI, throughpypa/gh-action-pypi-publishwith OIDC, in environmentstestpypiandpypi.Step 3 runs only when the repository variable
PYPI_PUBLISHistrue, so publishing a GitHub release before PyPI is set up does not produce failing jobs.Verification
python -m pytest -q: 127 passed, 13 skipped; it was 121 + 13, and the 6 new tests are intest_public_api.py. 5 of the 6 fail onmain.DXTRADE_SPEC_TESTS=1 python -m pytest tests/test_spec_conformance.py: 13 passed, against the live OpenAPI document.ruff: clean.mypy dxtrade_wrapper: no issues.python -m build, thentwine check --strict dist/*: both PASSED.pip install ".[test]" && pytestgives 127 passed, 13 skipped; onmainit was 7 collection errors.py.typedis present,DXTradeClientis exported.python scripts/check_release.py v0.2.0reports ok.… v0.2.1reportserror: tag v0.2.1 does not match __version__ 0.2.0and exits 1.actionlint1.7.7 is clean on both workflows.release.ymlcannot run before it is onmainand a release is published. Its build steps are the same commands as the CIpackagejob, which runs on this PR.examples/offline_demo.pystill runs end to end.Needs a human
dxtrade-python-wrapper; it anddxtrade-wrapperwere both free on PyPI on 2026-10-01. Change[project] namebefore the first upload if you prefer the shorter one, which matches the import name.Bogzx, repositoryDXtrade-python-wrapper, workflowrelease.yml, environmentpypi/testpypi.testpypiandpypi, with yourself as required reviewer onpypi.PYPI_PUBLISH=true.gh release create v0.2.0 --title v0.2.0 --notes-file <0.2.0 section of CHANGELOG>frommain.Development Status :: 3 - Alphawith that warning is honest, but whether to wait for a demo-account run is your call.The client-module split (P6) follows in a separate PR stacked on this one.
🤖 Generated with Claude Code