Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add flake to tests, format with black, and add precommit hooks #326

Merged
merged 2 commits into from
Oct 21, 2020

Conversation

domoritz
Copy link
Member

@domoritz domoritz commented Oct 21, 2020

This will cause a bit more work one time (need to run black on prs as well) but then should reduce friction for prs or maintaining style in the future.

  • Adds flake and black to ci
  • Adds flake and black to precommit hooks
  • Adds flake8 config file
  • Also tests scripts for flake issues

I was following https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/

@domoritz domoritz requested a review from ctb October 21, 2020 17:25
@ctb
Copy link
Member

ctb commented Oct 21, 2020

thanks - I want to dig into this a bit and try it out before committing (heh)! if you separate the fixes from the precommit hooks I'll happily merge those tho!

@domoritz
Copy link
Member Author

Sure. You want me to just remove precommit hooks but leave everything else?

@ctb
Copy link
Member

ctb commented Oct 21, 2020

actually, @luizirber is telling me to just go ahead with it 👍

let's give it a try!

@domoritz
Copy link
Member Author

🎉

@domoritz
Copy link
Member Author

I'll let you press the merge button @ctb

@ctb ctb merged commit 6394904 into latest Oct 21, 2020
@ctb ctb deleted the dom/black branch October 21, 2020 17:53
@luizirber
Copy link

(I have a similar PR in sourmash: sourmash-bio/sourmash#696
I based it on the setup that tox uses)

ctb pushed a commit that referenced this pull request Oct 21, 2020
)

* ci: add flake to tests, format with black, and add precommit hooks

* chore: use precommit hook from flake 8 repo
ctb added a commit that referenced this pull request Nov 5, 2020
* split bcalm sorting / input preparation into two steps

* fixed pendant removal

* simplify offset storage in pickle

* add comment

* flakes cleanup

* change tests to use new workflow; remove bcalm_to_gxt

* fix pendant removal code

* add debugging script, check-catlas-shadow-vs-cdbg

* add some shorter test files based on twofoo

* automated tests for twofoo-short checks

* update requirements, conda

* add test for root shadow nodes <-> unitigs

* add comment :)

* check md5 on gxt and catlas

* ci: switch to github actions, fix some linting issues (#323)

Co-authored-by: C. Titus Brown <titus@idyll.org>

* ci: add flake to tests, format with black, and add precommit hooks (#326)

* ci: add flake to tests, format with black, and add precommit hooks

* chore: use precommit hook from flake 8 repo

* update with make black and make flakes

* update version in setup.py

* use MPHF lookup to build { cdbg_id -> reads } index (#322)

* switch to a less khmer-specific read indexing approach, using mphf

* more frequent reporting is nice

* initial switch over to BBHashTable

* add use of get_unique_values

* rename index_contigs_by_kmer to index_cdbg_by_kmer

* bbhash -> bbhash_table

* use len(kmer_idx)

* fix typo

* add sizes output file

* switch to using count_cdbg_matches

* some fixes

* remove khmer thruout

* fix some label_cdbg calls

* fix tests

* update to newer version of bbhash

* bbhash >= 0.3 for new release

* whoops, bbhash >= 0.3 in requirements.txt

* create in sqlite; may not help, doesn't hurt

* raise exception when cDBG k-mers that should exist, don't

* update requirements to bbhash 0.5

* cleanup, while fixing tests

* update version

* fix setup.py

* Update install requirements, in preparation for conda-forge packaging. (#333)

* update version in setup.py

* update dependencies

* update version to 2.0b3

* fix sourmash dep :)

* switch to setuptools scm

* remove large files

* add long_description

* remove cython and mypy

* fix spelling

* Try moving contig sorting into sqlite (#338)

* fix spelling

* upgrade for latest sourmash (pre-4.0)

* add hacky sqlite-based sorting and storage

* rename cdbg directory to include ksize

* change bcalm output to be just 'bcalm.unitigs.fa'

* ok, I think it's all working now?

* update tests; minor cleanup

* better remapping

* cleanup

* clean up / remove print stmts

* fix tests

* fix test md5 again

* output count of all neighbors

* remove unused contigs.fa.gz filename setting

* sourmash migration -> 4.0

* create offset index too

* simplify & streamline neighbor parsing

* remove FastaWithOffsetAsDict

* misc cleanup

* tests save bacon, again

* add test for bad bcalm output check

* go back to relying on latest sourmash

* oops, remove old sourmash req

* update comments

* moar comment update

* fix return codes for tests

* reorder tests; rm requirements.txt

* use setup.py instead of requirements.txt

* update setup to install pre-commit hook foo

* swizzle requirements around a bit

* update workflow test to be less reliant on sourmash naming details that change in 4.x

* cleanup

* attempt fix install

* update setup

* khmer remove ver?

* install Cython too

* try build_ext -i instead

* revert last pile of changes b/c it's getting to be too much

* swap test order

* adjust @ctb comments

* finish updating @ctb flags with docs, cleanup

* black & flakes

Co-authored-by: Dominik Moritz <domoritz@gmail.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.

3 participants