@@ -59,38 +59,77 @@ Get Started!
5959
6060Ready to contribute? Here's how to set up `multicodec ` for local development.
6161
62- 1. Fork the `multicodec ` repo on GitHub.
62+ 1. Fork the `py- multicodec ` repo on GitHub.
63632. Clone your fork locally::
6464
65- $ git clone [email protected] :your_name_here/multicodec.git 65+ $ git clone [email protected] :your_name_here/py- multicodec.git 6666
67- 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development ::
67+ 3. Install your local copy into a virtualenv. Create and activate a virtual environment ::
6868
69- $ mkvirtualenv multicodec
70- $ cd multicodec/
71- $ python setup.py develop
69+ $ python -m venv venv
70+ $ source venv/bin/activate # On Windows: venv\Scripts\activate
71+ $ pip install -e ".[dev]"
7272
73- 4. Create a branch for local development::
73+ 4. Install pre-commit hooks (optional but recommended)::
74+
75+ $ pre-commit install
76+
77+ This will set up git hooks to automatically run linting and formatting checks
78+ before each commit.
79+
80+ 5. Create a branch for local development::
7481
7582 $ git checkout -b name-of-your-bugfix-or-feature
7683
7784 Now you can make your changes locally.
7885
79- 5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::
86+ 6. When you're done making changes, check that your changes pass linting and the
87+ tests, including testing other Python versions with tox::
8088
81- $ flake8 multicodec tests
82- $ python setup.py test or py. test
89+ $ make lint
90+ $ make test
8391 $ tox
8492
85- To get flake8 and tox, just pip install them into your virtualenv.
93+ Or run pre-commit manually on all files::
94+
95+ $ pre-commit run --all-files
96+
97+ If you installed pre-commit hooks (step 4), they will run automatically on commit.
98+
99+ Development Workflow Commands
100+ -------------------------------
101+
102+ The project provides several ``make `` targets to help with development:
103+
104+ * ``make fix `` - Automatically fix formatting and linting issues using ruff.
105+ Use this when you want to auto-fix code style issues.
86106
87- 6. Commit your changes and push your branch to GitHub::
107+ * ``make lint `` - Run all pre-commit hooks on all files to check for code quality
108+ issues. This includes YAML/TOML validation, trailing whitespace checks, pyupgrade,
109+ ruff linting and formatting, and mypy type checking.
110+
111+ * ``make typecheck `` - Run mypy type checking only. Use this when you want to
112+ quickly check for type errors without running all other checks.
113+
114+ * ``make test `` - Run the test suite with pytest using the default Python version.
115+ For testing across multiple Python versions, use ``tox `` instead.
116+
117+ * ``make pr `` - Run a complete pre-PR check: clean build artifacts, fix formatting,
118+ run linting, type checking, and tests. This is the recommended command to run
119+ before submitting a pull request.
120+
121+ * ``make coverage `` - Run tests with coverage reporting and open the HTML report
122+ in your browser.
123+
124+ For a full list of available commands, run ``make help ``.
125+
126+ 7. Commit your changes and push your branch to GitHub::
88127
89128 $ git add .
90129 $ git commit -m "Your detailed description of your changes."
91- $ git push origin name-of-your-bugfix-or-feature
130+ $ git push -u origin name-of-your-bugfix-or-feature
92131
93- 7 . Submit a pull request through the GitHub website.
132+ 8 . Submit a pull request through the GitHub website.
94133
95134Pull Request Guidelines
96135-----------------------
@@ -101,14 +140,17 @@ Before you submit a pull request, check that it meets these guidelines:
1011402. If the pull request adds functionality, the docs should be updated. Put
102141 your new functionality into a function with a docstring, and add the
103142 feature to the list in README.rst.
104- 3. The pull request should work for Python 2.6, 2.7 , 3.3 , 3.4 and 3.5, and for PyPy . Check
105- https://travis-ci.org /multiformats/py-multicodec/pull_requests
143+ 3. The pull request should work for Python 3.10, 3.11 , 3.12 , 3.13, and 3.14 . Check
144+ https://github.com /multiformats/py-multicodec/actions
106145 and make sure that the tests pass for all supported Python versions.
107146
108147Tips
109148----
110149
111150To run a subset of tests::
112151
113- $ py.test tests.test_multicodec
152+ $ pytest tests/test_multicodec.py
153+
154+ To run tests with coverage::
114155
156+ $ make coverage
0 commit comments