Release maintenance 101#27
Conversation
|
Hi, thanks so much. I don't have time right now to look into it, sorry. |
|
Could this include bump2version in setup.py (with version locks) and/or currently non-existent requirements.txt (which would also need to have lxml and six, ideally version locked? It's kind of a dev-only dependency but it's tiny and I think it's a really nice way to manage releases... Also in an ideal world I think you would add version to __version__ = "x.x.x"You then add this file to the bumpversion config so that it is updated correctly when you run the bumpverion command, and also, having this here means you can import this variable for use elsewhere. And you can do I'd volunteer to do this if it @mpasternak doesn't have time, and if you guys actually agree to start merging these maintenance PRs :) |
|
@interrogator I'm here, but feel free to do that. I really do hope other @infrae guys get their stuff together and start merging PRs. Let me know how it went. |
|
Although I technically have the permissions to merge PRs I will not merge any PR as long as Travis does not checks PRs, and I cannot enable that. |
|
So we wait on @jascoul 🐈 |
|
@wetneb what is needed for Travis to build PRs? Is it just a change in the .travis.yml? I feed bad for the project being on hold because of a lack of time on my part. |
|
@jascoul the |
|
@wetneb I removed Travis as an authorized app, is that what you meant? |
|
Yes, and now you should be able to add it back from travis-ci.org. |
`datetime.datetime.utcnow()` is deprecated since Python 3.12 and
scheduled for removal in a future version:
DeprecationWarning: datetime.datetime.utcnow() is deprecated and
scheduled for removal in a future version. Use timezone-aware
objects to represent datetimes in UTC:
datetime.datetime.now(datetime.UTC).
`datetime_to_datestamp()` in `oaipmh/datestamp.py` asserts that the
input has `tzinfo is None`, so we convert the timezone-aware UTC
value back to naive with `.replace(tzinfo=None)` before passing it
in. The resulting `responseDate` string in the OAI-PMH response is
unchanged.
This is the only `datetime.utcnow()` call in the codebase; after
this change, pyoai no longer emits `DeprecationWarning` for it on
Python 3.12+.
Replace deprecated datetime.utcnow() with timezone-aware equivalent
- Generated pyproject.toml with metadata migrated from setup.py/setup.cfg - Python requirement raised to >=3.10 (dropping EOL 2.7/3.5-3.9) - Initialized uv; uv.lock added to .gitignore (library) - Removed obsolete packaging files: setup.py, setup.cfg, MANIFEST.in - Updated .gitignore with modern Python patterns Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Normalized version 2.5.2pre -> 2.5.2 (PEP 440 compliant) - Added [tool.bumpver] config to pyproject.toml - Single source of truth: pyproject.toml only Previously the version was inconsistent: setup.py had 2.5.2pre while setup.cfg bumpversion pointed to 2.5.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Added .pre-commit-config.yaml with ruff lint + format - Configured ruff with basic flake8-equivalent rules (E, F, W) - Hooks run only on staged files — existing code not reformatted - Added hygiene hooks: trailing-whitespace, end-of-file-fixer, check-yaml, check-added-large-files, detect-private-key Install with: pre-commit install Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Python matrix: 3.10, 3.11, 3.12, 3.13 (was 2.7, 3.6-3.8) - Use uv for Python install + dependency resolution - Replace tox invocation with direct pytest - Upgraded action versions: checkout@v4, setup-uv@v5 - Added informational-only ruff lint job (non-blocking) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Configured [tool.pytest.ini_options] in pyproject.toml - python_classes = ["*TestCase"] to avoid collecting non-test TestError - Removed tox.ini and src/oaipmh/tests/runtests.sh Python 3.12+ compatibility fixes (required for test matrix): - pkg_resources (removed from stdlib setuptools) -> importlib.metadata - unittest.makeSuite / test_suite() -> removed (dead code for zope.testrunner) - unittest.assertEquals (removed alias) -> assertEqual - unittest.assert_ (removed alias) -> assertTrue - lxml evaluator.evaluate (removed attribute) -> evaluator is callable directly - Relative imports: `from fakeclient` -> `from .fakeclient` - Dropped Python 2 compat shims (StringIO fallbacks, urllib2 fallback, six.PY2/PY3) All 58 tests pass on Python 3.13. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Replaced six.text_type with str - Removed six.PY3 check (always True) - Removed six from [project] dependencies Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deleted: - .hgignore, .hgtags (Mercurial remnants, repo is on git) - buildout.cfg (zc.buildout config; replaced by uv) - Makefile (referenced `python setup.py sdist upload`; had bogus path from another project; superseded by uv) - INSTALL.txt (outdated: mentioned Python 2.3, `python setup.py install`, and codespeak lxml URL) README.rst: - Fixed Python 2 `print record` -> `print(record)` - Updated CI badge to new workflow URL (mpasternak/pyoai) - Added Python version support badge (3.10-3.13) - Added modern installation instructions (pip, uv) - Added development quickstart (uv sync, uv run pytest) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Hi,
support "bumpversion" so you can release new versions easily (pip install bumpversion; bumpversion patch; git push --tags)
support universal wheel target in setup.cfg
release target for makefile so you can easily release sdist + wheel at once
credits go to @pydanny and @audreyr for creating cookiecutter-pypackage.