Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Vinícius Figueiredo
@mvinoba
you certainly didn't :)
yeah, importing is fine now and working as intended, I'm just setting up a python 3.6 environment so I can properly do the lintering with black
Vinícius Figueiredo
@mvinoba
well, pipenv run tox -e lint exits with Error: the command tox could not be found within PATH or Pipfile's [scripts].. However, I see you released a new version that changes how to run the lintering tests, should I just fetch and pull and try that?
Also, I guess some of my pipenv install commands while trying to get everything to work changed the Pipfile file, and I probably shouldn't stage that for commit. @alcarney
Alex Carney
@alcarney
Sounds like you only have the runtime dependencies installed, there are a few extra ones needed for development which can be installed using pipenv install --dev
You should be able to reset your Pipfile (assuming you didn't commit your changes to it) by running git checkout Pipfile which will undo any of the unstaged changes
Alex Carney
@alcarney
By all means update your copy to the latest as it will have to be done eventually to get your changes in, but the only change I made to the running of the tests was to setup a shortcut in pipenv so that we don't have to type out tox -e ... all the time
Does that help you? @mvinoba
Vinícius Figueiredo
@mvinoba
so...
I now get an invocation error for black
image.png
Vinícius Figueiredo
@mvinoba
I guess that's something to do with my python3.6 environment, right?
Vinícius Figueiredo
@mvinoba
I just did a (stylo-yUhZlOII) vinicius@debian:~/stylo$ pipenv install --dev --python 3.6 and I still got the same error
Alex Carney
@alcarney

That's actually a "good" error.

Black rewrites everyone's code so that all the code all across the repository is written in a consistent style, in theory it makes it easier to read as everything looks as you would expect it to. If you look at the message in white above the error 1 file would be reformatted that's black telling you the file doesn't follow the same style so black wants to rewrite it, which fails the test.

Good news is that the fix is easy, all that's needed is to tell black to rewrite the file. Which can be done by running (stylo-yUhZl0II) $ black stylo/
Vinícius Figueiredo
@mvinoba
oh, I see
I wasn't expecting an InvocationError, just a message or some sort of suggested changes diff
thank you!
Alex Carney
@alcarney
No worries, I guess tox isn't smart enough to know which errors are the kind we are interested in
Vinícius Figueiredo
@mvinoba
oh, but $ black stylo/ says command not found. Do I need to install it system-wide?
Alex Carney
@alcarney
There's a chance that black might not be available in your virtualenv, so feel free to run $ pipenv install --dev black
That will modify the Pipfile and Pipfile.lock which is probably for the best as it should be there.
Vinícius Figueiredo
@mvinoba
great
this did the trick
Alex Carney
@alcarney
:+1:
Vinícius Figueiredo
@mvinoba
just submitted a PR
I created a branch to work on the feature, not sure if I should have done the work on the dev branch instead
travis fails in the lint process
and now apparently my pipenv run lint fails as well
flake8 stylodoesn't work either, I guess that I also need to install it then
Vinícius Figueiredo
@mvinoba
flake8 reports some line breaks before binary operators but that's just what black did to my code :(
Alex Carney
@alcarney
@mvinoba I've added a few suggestions as a comment on the PR, I'm hoping that the first one will fix the issues with flake8 - it's frustrating that the two seem to be disagreeing...
Creating a branch is probably the right thing to do as it can make things easier to merge when you have multiple people doing work at the same time. My only question is did you branch off from develop?
I also switched the base of your PR from master to develop that way we can do the extra things like adding stuff to the changelog before we push a new version out
Vinícius Figueiredo
@mvinoba
I branched off from master instead, do I need to change it?
Vinícius Figueiredo
@mvinoba
@alcarney Apparently that's a known issue ambv/black#52
Alex Carney
@alcarney
Umm, since GitHub is telling me that the PR can be merged without conflict I'm going to assume it will be ok. However in future it's probably best to branch of from develop - something else that I'm going to have to write up at some point...
Just read the issue you linked - if we can't make the problem go away we can always disable the W503 warning.
Vinícius Figueiredo
@mvinoba
okay! :)
I'm working on your PR comment bullet points
apparently even breaking down into smaller method black still wants to break line on the binary operators
Vinícius Figueiredo
@mvinoba
hey @alcarney , quick question, I'm working o 2nd bullet point adding references and short explanation to the docstring itself, should I link URLs using `something<url>`or markdown style [something](url)
I mean, like in rst syntax or in md style?
Alex Carney
@alcarney
rst syntax as the docstrings are copied into the documentation that's built by Sphinx
Alex Carney
@alcarney
There's now a stylo-doodles repository! The plan is to have an examples gallery that anyone can contribute a jupyter notebook to
https://github.com/alcarney/stylo-doodles/tree/master/notebooks
There is this service called binder that supposedly can take a repository containing jupyter notebooks and it will let you play with them in the browser without having to install any software - there's a link in the readme
It does take about 5min to set itself up
Alternatively I'm thinking of looking to see if I can write a script to build a Jekyll static site from the notebooks.
Vinícius Figueiredo
@mvinoba
pretty neat!
@alcarney what would be simplest way to draw a semicircle? something like Circle(0,0,.5) & (~Rectangle(0,0,1,.5) >> translate(0,-.25)) doesn't work since transforms don't return new shapes
Alex Carney
@alcarney
I think until transforms are fixed to work with composites the easiest way will be to do the transformation by hand... Something like
Circle(0, 0, 0.5) & ~Rectangle(0, -0.25, 1, 0.5)