Comments (11)
hey there! i've talked to @anapaulagomes and i'd like to take this issue. (:
from model_bakery.
hey @berinhard and @anapaulagomes !
I've just added black to our pre-commit
file, tested it and some files were reformatted. π
now I'm trying to add it to Travis as well, but I never did this before and I'm kinda lost... should I add it to .travis.yml
file? if so, where should I place it?
also, I thought about creating a CONTRIBUITING
file or a section like that in the README
, so we could explain a few things like "you have to add your ssh key to github, otherwise pre-commit won't work" (at least I had this problem hahah). what do you think?
from model_bakery.
Awesome! I've learned a lot so far. π
A few days ago, I've added black
to tox.ini
file and I tried to do tox -e black
. It seemed to work fine. Also skipping pydocstyle
helped me debug a lot. π
Right now I'm trying to correct the tests/
files in some way that both black
and flake8
will pass the test, because apparently they are conflicting (when one succeeds, the other one fails). If all works, I'll separate the black
job.
Thanks for all the support! β€οΈ
from model_bakery.
That's great, @giovana-morais! Yes, you should add this command to the section script
(https://github.com/model-bakers/model_bakery/blob/master/.travis.yml).
The contribution guide is a great idea but I think we already have one in place in our docs: https://model-bakery.readthedocs.io/en/latest/#contributing-to-model-bakery. It may need to be updated though... π€ About this issue specifically, I think it's out of scope of this project.
Feel free to ping me if you have any questions. I'm commenting from my phone so I apologise if something is missing. Thank you!
from model_bakery.
Thanks @anapaulagomes for helping with this! I was traveling for the last few days with my family and I only got back to work today. Thanks @giovana-morais for all the effort as well!
from model_bakery.
Done #42. βοΈ
from model_bakery.
Nice! I think would be nice to add it to Travis as well, @berinhard.
from model_bakery.
Sure @giovana-morais! Feel free to tackle this one and thanks for your help π
from model_bakery.
Done! I added it before tox checks and now I'm running Travis CI in my branch to see if everything is okay in the build. I'm not sure if it's the best way to do so, but anyways. ahahah
I'm only having some trouble now because after black reformatted the source files, flake8 and pydocstyle are failing. Did this happen before? I can't commit the formatted files because of this. Sorry to bother D:
EDIT: I found out that when I try to build with Python 3.5 , pip install black
won't work. Higher versions than that work, but then fail because the scripts are not formatted (yay!). Is there anything you know I can do to solve this?
from model_bakery.
Done! I added it before tox checks and now I'm running Travis CI in my branch to see if everything is okay in the build. I'm not sure if it's the best way to do so, but anyways. ahahah
No worries, I think you're in the right path. :)
I'm only having some trouble now because after black reformatted the source files, flake8 and pydocstyle are failing. Did this happen before? I can't commit the formatted files because of this. Sorry to bother D:
So, I've checked and seems that flake8
is failing on our tests
module at least. Would you be kind to fix the issues there? About pydocstyle
, I'd say to skip it this time - only because to solve it we'd have to add comments to many public methods. You can skip it using SKIP=pydocstyle
before your git commit
command (like SKIP=pydocstyle git commit -m ""
).
EDIT: I found out that when I try to build with Python 3.5 , pip install black won't work. Higher versions than that work, but then fail because the scripts are not formatted (yay!). Is there anything you know I can do to solve this?
I'm glad that it works! π Just now I realized that I suggested you to add to the script section. Sorry about that. The ideal place would be tox.ini
file, like we did for flake8
:
Lines 1 to 6 in e57b42f
and https://github.com/model-bakers/model_bakery/pull/39/files
BUT it will run for every job... And still break for 3.5. So, I left a comment about this in my PR (#39 (comment)) (cc @amureki, @berinhard). Since I'm not a Travis knight, let's put this part on hold and see what they say.
Good job so far! @giovana-morais
from model_bakery.
Ok, now (thanks to @amureki) we have separated job for flake8 (#40). You can use the same structure for black, @giovana-morais. π¬
from model_bakery.
Related Issues (20)
- TypeError: field fieldName TypeError HOT 2
- Feature request: Support setting random seed for repeatable test runs HOT 2
- `make()` with `_bulk_create=True` does not create M2M-entries that are specified using the reverse/related name.
- Using `related` with FK relation creates a duplicate entity HOT 1
- FR: m2m through model with extra fields HOT 2
- RangeFields are broken on Django 4.2
- String generation fails on Django 4.2 for CharField(max_length=None)
- utils.seq does not start from 0
- `GenericForeignKey` not accounted for in `baker._skip_field()` HOT 5
- TypeError: <class 'jsonfield.fields.JSONField'> is not supported by baker. HOT 4
- How do I deal with complex relationships?
- Overwriting one attribute deletes foreign key data in v1.14 HOT 11
- Use existing object by foreign_key relationship
- Installation documentation references incorrect package name HOT 2
- `_bulk_create` without `_quantity` will be ignored
- auto_now_add=True Fields do not match baker.make return
- Using other fields to generate data
- Reverse one-to-one relation not persisting in database
- Feature request: Ability to exclude fields in _fill_optional
- m2m, through fields and _bulk_create seems broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from model_bakery.