Skip to content

Codex modernize packaging ci#1

Merged
philipwfowler merged 5 commits into
masterfrom
codex-modernize-packaging-ci
Jun 3, 2026
Merged

Codex modernize packaging ci#1
philipwfowler merged 5 commits into
masterfrom
codex-modernize-packaging-ci

Conversation

@philipwfowler

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the project’s packaging and CI setup by migrating metadata to pyproject.toml, adding a GitHub Actions workflow, and introducing a proper installed CLI entrypoint, alongside new pytest coverage for the CLI and core Classifications behavior.

Changes:

  • Replace legacy setup.py packaging with a PEP 621 pyproject.toml (deps, dev extras, console script) and update README install/usage docs.
  • Add a pyniverse.cli module and wire both the console script and existing bin/ wrapper to it.
  • Add CI (black/ruff/pytest) and introduce new tests plus Matplotlib test configuration.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_cli.py Adds CLI integration tests (expected PDFs + private project flag behavior).
tests/test_classifications.py Adds unit tests for input validation, filtering, and error handling.
tests/conftest.py Configures Matplotlib backend/config dir for test execution.
setup.py Removes legacy setuptools configuration in favor of pyproject.toml.
README.md Updates installation and CLI usage instructions for the new packaging/entrypoint.
pyproject.toml Defines build system, dependencies, dev extras, lint/format/test tool config, and console script.
pyniverse/ZooniverseClassifications.py Modernizes core class behavior (validation, filtering, plotting, error handling).
pyniverse/cli.py Introduces the new argparse-based CLI implementation.
pyniverse/__init__.py Exposes Classifications via __all__.
bin/zooniverse-classifications-analyse.py Converts legacy script into a thin wrapper around pyniverse.cli:main.
.gitignore Ignores Matplotlib config dir created during tests.
.github/workflows/ci.yml Adds multi-Python-version CI running black, ruff, and pytest.
Comments suppressed due to low confidence (1)

pyniverse/ZooniverseClassifications.py:245

  • plot_user_classification_distribution() saves a Matplotlib figure but never closes it. In CLI/test runs this can accumulate open figures and memory (especially when called repeatedly).
        axes1.set_xlabel("cumulative contributors")
        axes1.set_ylabel("cumulative classifications")
        fig.savefig(stem + file_extension, transparent=True)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 140 to 158
@@ -154,29 +143,34 @@ def __repr__(self):
top_10 = (
100 * self.users.classifications[:10].sum()
) / self.total_classifications
line += "%30s %7.1f %%\n" % ("Top 10 users have done:", top_10)
line += f"{'Top 10 users have done:':>30} {top_10:7.1f} %\n"
top_100 = (
100 * self.users.classifications[:100].sum()
) / self.total_classifications
line += "%30s %7.1f %%\n" % ("Top 100 users have done:", top_100)
line += f"{'Top 100 users have done:':>30} {top_100:7.1f} %\n"
top_1000 = (
100 * self.users.classifications[:1000].sum()
) / self.total_classifications
line += "%30s %7.1f %%\n" % ("Top 1000 users have done:", top_1000)
line += f"{'Top 1000 users have done:':>30} {top_1000:7.1f} %\n"

# sort the table so the top users are last
# restore descending order after reporting headline numbers
self.users.sort_values(["classifications"], ascending=False, inplace=True)

Comment thread pyniverse/ZooniverseClassifications.py Outdated
Comment thread tests/conftest.py Outdated
philipwfowler and others added 2 commits June 3, 2026 15:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@philipwfowler philipwfowler merged commit d5676f8 into master Jun 3, 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.

3 participants