Skip to content

Release maintenance 101#27

Open
mpasternak wants to merge 13 commits into
infrae:masterfrom
mpasternak:master
Open

Release maintenance 101#27
mpasternak wants to merge 13 commits into
infrae:masterfrom
mpasternak:master

Conversation

@mpasternak
Copy link
Copy Markdown
Contributor

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.

@jascoul
Copy link
Copy Markdown
Collaborator

jascoul commented Jul 7, 2017

Hi, thanks so much. I don't have time right now to look into it, sorry.
It will be the end of next week before I can do an update.

@interrogator
Copy link
Copy Markdown

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 src/pyoai/__init__.py with a line like:

__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 import pyoai; pyoai.__version__ to see what's current installed. As far as I know, that's the standard way of doing this at the moment.

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 :)

@mpasternak
Copy link
Copy Markdown
Contributor Author

@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.

@wetneb
Copy link
Copy Markdown
Collaborator

wetneb commented Apr 26, 2020

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.

@interrogator
Copy link
Copy Markdown

So we wait on @jascoul 🐈

@jascoul
Copy link
Copy Markdown
Collaborator

jascoul commented Apr 28, 2020

@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.
I would like to have the whole release maintenance sorted out. If you are willing to take the responsibility, I will also add you to Pypi so you can do new releases.

@wetneb
Copy link
Copy Markdown
Collaborator

wetneb commented Apr 28, 2020

@jascoul the .travis.yml is fine, it is the Travis integration in GitHub. One easy way to fix it would be to disable the Travis integration entirely in the GitHub project settings, and add it again from Travis. This would set up the integration correctly.

@jascoul
Copy link
Copy Markdown
Collaborator

jascoul commented Apr 28, 2020

@wetneb I removed Travis as an authorized app, is that what you meant?

@wetneb
Copy link
Copy Markdown
Collaborator

wetneb commented Apr 28, 2020

Yes, and now you should be able to add it back from travis-ci.org.

wetneb and others added 10 commits March 9, 2022 10:13
`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>
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.

4 participants