Skip to content

Commit

Permalink
Merge pull request #190 from icenet-ai/v0.2.7_dev
Browse files Browse the repository at this point in the history
V0.2.7 dev
  • Loading branch information
JimCircadian committed Jan 20, 2024
2 parents 4608624 + 3d374f0 commit cb1cb78
Show file tree
Hide file tree
Showing 69 changed files with 3,367 additions and 2,313 deletions.
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
exclude: (LICENSE|README.md|setup.py)
repos:
# General pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
language_version: python3

# # isort - Sorting imports
# - repo: https://github.com/pycqa/isort
# rev: 5.12.0
# hooks:
# - id: isort
# args: ["--filter-files"]

# yapf - is doing my head in with making modifications, so removing as it make non-pep8
# compliant changes
#- repo: https://github.com/google/yapf
# rev: v0.40.2
# hooks:
# - id: yapf
# name: "yapf"
# args: ["--in-place", "--parallel"]
# exclude: "docs/"

# ruff - Linting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
args: []

- repo: local
hooks:
# Run pytest
- id: pytest
name: Run pytest
entry: pytest
language: system
pass_filenames: false
6 changes: 6 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
line-length = 120

[lint]
select = ["E", "F"]
ignore = ["E721"]
exclude = ["setup.py"]
38 changes: 22 additions & 16 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,36 @@ Ready to contribute? Here's how to set up `icenet` for local development.

$ mkvirtualenv icenet
$ cd icenet/
$ python setup.py develop
$ pip install -e .

4. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the
tests, including testing other Python versions with tox::
5. Install development packages::

$ flake8 icenet tests
$ python setup.py test or pytest
$ tox
$ pip install -r requirements_dev.txt

To get flake8 and tox, just pip install them into your virtualenv.
6. Set up pre-commit hooks to run automatically. This will run through linting checks, formatting, and pytest. It will format new code using yapf and prevent code committing that does not pass linting or testing checks until fixed::

6. Commit your changes and push your branch to GitHub::
$ pre-commit install

7. When you're done making changes, check that your changes pass flake8 and the tests::

$ make lint
$ pytest

8. Commit your changes and push your branch to GitHub::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

7. Submit a pull request through the GitHub website.
Note: When committing, if pre-commit is installed, the commit might be prevented if there are problems with formatting. In this case, deal with the file(s) and commit again.

9. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------
Expand All @@ -112,12 +118,12 @@ TODO
Deploying
---------

A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.rst).
Then run::
A reminder for the maintainers on how to deploy::

# Update icenet/__init__.py
$ git push
$ git push --tags
$ make clean
$ make lint # Ignore black moaning at present
$ make docs
$ make install
$ make release

Travis will then deploy to PyPI if tests pass.
If anything looks really wrong, abandon and fix!
5 changes: 3 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
History
=======

0.2.* (2022-11-22)
0.2.* (2022-2024)
------------------

* First releases to PyPI
* Still under development but usable codebase for training and prediction
* Use alongside icenet-pipeline and icenet-notebooks
* Proper releases will follow >=0.2.1, otherwise alpha versioned for the mo
* Alpha only, beta releases will follow 0.2
* 0.2 is maintained for the sake of adoption, with 0.3 to be a beta version

0.1.* (2021-2022)
-----------------
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.md
include requirements*.txt
include docs/requirements.txt

recursive-include tests *
recursive-exclude * __pycache__
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ dist: clean ## builds source and wheel package
ls -l dist

install: clean ## install the package to the active Python's site-packages
python setup.py install
pip install -e .
7 changes: 6 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ BUILDDIR = _build
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile
.PHONY: help html Makefile

# When running "make html": Run pyreverse to generate UML diagram if outputting html docs.
html:
pyreverse --output puml --output-directory ./ --project icenet ../icenet --colorized
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Expand Down

0 comments on commit cb1cb78

Please sign in to comment.