Skip to content

Modernize package#62

Merged
rucker merged 17 commits intomasterfrom
modernize-package
Jan 30, 2026
Merged

Modernize package#62
rucker merged 17 commits intomasterfrom
modernize-package

Conversation

@rucker
Copy link
Owner

@rucker rucker commented Jan 14, 2026

  • Refactor project layout.
  • Add pyproject.toml.
  • Replace global state vars with Config dataclass.
  • Remove unused imports and obsolete env module from package.
  • Move tests to top-level tests/ directory.
  • Convert tests from unittest to pytest.
  • Remove obsolete test directory, env module, and config files.
  • Apply code quality tools: black, isort, mypy, ruff.
  • Update documentation for modern packaging.
  • Add --version flag. Bump version to 5.0.0.
  • Exclude binary files from compilation (Resolves [ioutils] Vim swap files included for compilation #56).
  • Add CLAUDE.md.
  • Handle nested dotfiles (implements Feature: Handling of dotfiles whose location is nested under OUTPUT_DIR #49).

- Move all test files from dotfilesmanager/test/ to tests/
- Add tests/__init__.py
- Add tests/conftest.py with pytest fixtures for test environment
- Remove unittest.TestCase inheritance, use plain pytest classes
- Remove sys.path manipulation and old test.env imports
- Update imports to absolute package imports (dotfilesmanager.*)
- Replace setUp/tearDown with pytest fixtures (test_config, temp_dirs)
- Convert assertions from unittest style (self.assertTrue) to pytest style (assert)
- Use pytest fixtures for mocking (capsys, monkeypatch)
- Replace all env global state references with Config object
- Update all function calls to pass config parameter
- Use Path objects instead of string paths where appropriate
- Delete dotfilesmanager/test/ directory (tests moved to top-level tests/)
- Delete dotfilesmanager/env/ module (replaced by Config dataclass)
- Remove .pylintrc files (using ruff for linting)
- Clean up tmp/ directory and __pycache__ directories
- Package structure now simplified to core modules only
- Format code with black (100 char line length)
- Sort imports with isort
- Fix mypy type errors:
  - Add bool() casts to Config property returns
  - Fix printe() kwargs typing (object -> Any)
- Remove unused imports flagged by ruff
- Modernize Generator import (typing -> collections.abc)
- Update pyproject.toml ruff config to use new lint section
- All type checks pass (mypy --strict)
- All linting passes (ruff)
- All 33 tests pass
- Add installation instructions (pip install from source)
- Add development installation section (pip install -e .[dev])
- Add testing instructions (pytest with coverage reports)
- Update all command references from 'dfm.py' to 'dfm' CLI command
- Add Usage section header for better organization
test.yml:
- Run tests on every push/PR to master/main
- Test against Python 3.10, 3.11, 3.12, 3.13
- Generate coverage reports
- Upload coverage to Codecov (optional)

quality.yml:
- Check code formatting with black
- Check import sorting with isort
- Type check with mypy
- Lint with ruff
- Enforces code quality standards on every push/PR

README.md:
- Add status badges for Tests and Code Quality workflows
- Badges link to GitHub Actions workflow runs

All workflows are free for public repositories.
Tests run in parallel across 4 Python versions for comprehensive validation.
.github/WORKFLOWS.md:
- Complete guide to CI/CD workflows
- Explains test and quality workflows
- Instructions for viewing results and fixing failures
- Branch protection setup guide
- Troubleshooting common issues
- Running checks locally
- Codecov integration details
- Cost breakdown (free for public repos)
- Advanced configuration options

README.md:
- Add prominent link to workflow guide after badges
- Makes CI/CD documentation easily discoverable
Fixes pip wrapper script warning that occurs on some systems.

Updated files:
- README.md: Installation and development commands
- .github/WORKFLOWS.md: All pip install examples
- .github/workflows/test.yml: Dependency installation
- .github/workflows/quality.yml: Dependency installation

Using 'python -m pip' is the recommended modern best practice:
- Guarantees pip version matches Python interpreter
- Avoids issues with outdated wrapper scripts
- Works consistently across all platforms
- Recommended by pip maintainers (github.com/pypa/pip/issues/5599)
README.md:
- Add venv creation/activation to installation instructions
- Add venv setup to development installation section
- Remove redundant externally-managed-environment note (won't occur with venv-first)

.github/WORKFLOWS.md:
- Add venv setup to 'Running Checks Locally' section
- Remove 'Externally-Managed-Environment Error' troubleshooting section
  (redundant since installation docs now use venv from the start)

Rationale:
- Virtual environments are Python best practice
- Works on all systems (old and new Linux distributions)
- Prevents dependency conflicts
- Simpler user experience (one clear path, no conditional instructions)
- Matches what major Python projects recommend (Django, Flask, pytest)
@rucker rucker force-pushed the modernize-package branch from e207236 to 558a391 Compare January 16, 2026 01:02
@rucker rucker merged commit 65564b1 into master Jan 30, 2026
5 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.

[ioutils] Vim swap files included for compilation

1 participant