Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 16 19:22
    FlorianWilhelm closed #247
  • Oct 16 19:22

    FlorianWilhelm on pytest_virtualenv

    (compare)

  • Oct 16 19:21

    FlorianWilhelm on dev

    (compare)

  • Oct 16 19:12
    FlorianWilhelm commented #239
  • Oct 16 19:12
    FlorianWilhelm commented #247
  • Oct 16 19:06

    FlorianWilhelm on v4.0.x

    Fix merge errors (compare)

  • Oct 16 18:54
    FlorianWilhelm commented #238
  • Oct 16 18:54
    FlorianWilhelm closed #238
  • Oct 16 18:49

    FlorianWilhelm on dev

    Fix merge errors (compare)

  • Oct 16 18:30

    FlorianWilhelm on dev

    Fix merge errors (compare)

  • Oct 16 18:22

    FlorianWilhelm on dev

    Fix merge errors (compare)

  • Oct 16 18:02

    FlorianWilhelm on dev

    Fix merge errors (compare)

  • Oct 14 08:42
    abravalheri commented #244
  • Oct 14 05:49
    FlorianWilhelm closed #244
  • Oct 14 05:49
    FlorianWilhelm commented #244
  • Oct 12 19:43

    FlorianWilhelm on v4.0.x

    Merge branch 'master' into v4.0… (compare)

  • Oct 12 19:40

    FlorianWilhelm on master

    Replaced Travis by Cirrus (compare)

  • Oct 12 18:57

    FlorianWilhelm on v4.0.x

    Merge branch 'master' into v4.0… (compare)

  • Oct 12 18:43

    FlorianWilhelm on v4.0.x

    Add github icons Added .DS_Store to gitignore Create FUNDING.yml Added a way… and 84 more (compare)

  • Oct 12 18:26

    FlorianWilhelm on dev

    (compare)

Holger Peters
@HolgerPeters
and no reading of a requirements.txt in the setup.py
PlkMarudny
@PlkMarudny
Hi, I do not get the skeleton.py construction. There is a statement "from fibonacci import version", but how is that supposed to be handled when a script is run from a command line? In other words, this skeleton is not supposed to be used as is for development purposes, am I right?
Florian Wilhelm
@FlorianWilhelm
Hi @PlkMarudny , the script is just an example but of course it works. Judging from the statement "from fibonacci import version" you named your package "fibonacci". When the script (in this case also named "fibonacci") is called from the command line Python knows where to locate the package fibonacci and calls the ´´run´´ function. This is just a normal functionality of Python's distutils and setuptools to allow you creating console commands.
PlkMarudny
@PlkMarudny
Hi, yes, that's correct; just wanted to know how to run it without installing. i.e. without using setup.py In such a case "from fibonacci import version" has no meaning, right? Sorry, I am quite new to Python, just wanted to use your excellent tool without any modification and just somehow got stack at this statement (and yes, I name the package 'fibonacci').
Florian Wilhelm
@FlorianWilhelm
Without installing it "from fibonacci import version" would try to find the package fibonacci (which is not installed) and fail with an ImportError. So in that sense it has no meaning...
But better is to run "python setup.py install" or "python setup.py develop" and test it.
PlkMarudny
@PlkMarudny
"python setup.py develop" followed by "python .\fibonacci\fibonacci.py 4" gives the same 'cannot import name version' error actually, that I am not quite sure is right or wrong
Florian Wilhelm
@FlorianWilhelm
@PlkMarudny Hm... I think somehow you are missing the point. So let's do it step by step 1) Activate your virtual environment 2) create a project like "putup fibonacci_pkg" 3) Go in the directory and edit setup.cfg, make sure the two lines "consolescript =" and "fibonacci ...." are uncommented. 4) now run "python setup.py develop" 5) You are done, now frome every directory you can run "fibonacci 42" for instance as long as you are in the virtual environment
This is because you have installed the console script fibonacci inside a special directory in your virtualenvironment which is automatically added to your PATH variable. The console script will then indirectly call fibonacci.py. Cool, huh? This is btw the default way of using Python to create console scripts that can be used like any other command in your system like "ls" in Linux or "dir" in Windows. This is much more convenient than calling Python scripts directly....
PlkMarudny
@PlkMarudny
Thanks for explanation. Indeed, I had virtual env deactivated. Indeed that way is way better than scripts called directly. Thanks for effort and excellent package.
Christoph Paulik
@cpaulik
I have the following in my setup.cfg but the bin files are not included in the source distribution?
data_files =
           tests/ = tests/**.bin
Am I doing something wrong?
Christoph Paulik
@cpaulik
I just read the Note in the documentation Make sure that all files you specify in [files] have been added to the repository! Does this mean I can not add files to the source distribution that are not in git?
Florian Wilhelm
@FlorianWilhelm
@cpaulik You are right about this. Python packaging is a mess und for source distribution to include non-python files you would need to specify them in a MANIFEST.in file. PyScaffold is using pbr which helps to streamline the generation of source and binary distribution. Somehow that only works if files are checked into git and in that common case no MANIFEST.in is needed. My question would be why do you not want to include those files in your git repo but still want to ship them in a source distribution? Another work around would be to use wheel packages which are the new way anyway.
Christoph Paulik
@cpaulik
@FlorianWilhelm My use case is that I have binary test data which is not in git since it is quite large. This data will not be installed on the target system but should be included in the source distribution for testing purposes. But the fact that it is not in git might change if we start using git-lfs. For the moment I've introduced a MANIFEST.in to work around this limitation.
Christoph Girstenbrei
@girstenbrei
First things first, thanks to you all, I just started using pyscaffold, awesome work! Second, more specific: I noticed, that setting up a project with travis-ci, the .travis.yml + travis_install.sh result in 4 environments by default, at least one wasn't working for me (I am aware, we are just talking about defaults). My problem: distributed responsibilities between .travis.yml and travis_install.sh. Proposed solution would be switching to python versions as used here. Result is basically the same (probably including the failing default), but configuration would be located only in .travis.yml, removing travis_install.sh initially. There would be no dependencies to miniconda, all package installation would be done via pip (as recommended here ), pip could be added to the cache section of .travis.yml. I like the idea of having the file travis_install.sh present, to show how it is possible to extend installation and make it easier for further use. I made a gist as example of .travis.yml. If there is interest in this change, I'd be happy to implement it and provide a pull request.
Florian Wilhelm
@FlorianWilhelm
@girstenbrei Sounds good to me as it would really simplify things if we could get rid of travis_install.sh. Let's hear what @HolgerPeters and @sebastianneubauer have to say about that.
Florian Wilhelm
@FlorianWilhelm
@girstenbrei Seems like everyone is on vacation but you got my blessings :-) I am looking forward to your PR!
Christoph Girstenbrei
@girstenbrei
@FlorianWilhelm Hope everyone enjoys their vacation! Do you have a contribution-guide or is their anything you would like me to know, before I start?
Florian Wilhelm
@FlorianWilhelm
@girstenbrei Just make sure that the changes are unit and pep8 tested. Ahh and there is https://pyscaffold.readthedocs.io/en/latest/contrib.html
Christoph Girstenbrei
@girstenbrei
@FlorianWilhelm Thanks, no problem, I'll come back as soon as I'm done :smile:
John Puskar
@jpuskar
Hey, I'm pretty new to Python. I ran putup my_project and customized setup.cfg. How do I get pyscaffold to rebuild my setup.py file? Or was I supposed to have setup.cfg inside the target project directory before running putup?
Florian Wilhelm
@FlorianWilhelm
Hej @jpuskar, you don't need to run anything. Setup.py will read setup.cfg and use your settings accordingly.
John Puskar
@jpuskar
Cool; ty. Yeah I realize I was thinking about it all backwards. Thanks :).
Jose Miguel Colella
@josecolella
@FlorianWilhelm I have been looking for something to automate getting a project up and running quickly. Thanks for this! :+1:
flip111
@flip111
how can i change the default .gitignore so that i can add the directory that virtualenv creates?
Florian Wilhelm
@FlorianWilhelm
@josecolella Thanks for the feedback :-) It's always a pleasure to see people using PyScaffold and knowing that it helps them.
Hi @flip111 , you would have to do that in the templates folder of PyScaffold and create a PR but actually what would not get accepted since PyScaffold will remain agnostic to which kind of virtual environment you are using. Not everyone uses the same virtualenv name and also people using conda don't even have that problem because their environments are managed in a special subdirectory. I deeply appreciate your input and suggestions for improvements but right now my suggestion would be to first learn a bit more about the typical workflows of Python developers since you said you are quite new to Python.
EgonFrerich
@EgonFrerich
I want to use pyscaffold with cookiecutter and my own cookiecutter template. I changed pyscaffold a bit so that i start putup with a cookiecutter template. But the template uses jinja and so I get an error that the tag 'raw' is unknown. What should I do?
Florian Wilhelm
@FlorianWilhelm
@EgonFrerich Maybe your jinja2 version is incompatible with cookiecutter? Have you seen this issue? pydanny/cookiecutter-django#528
It's cool that you work on that btw, do you want to provide an PR in the end? With the changes for PyScaffold?
EgonFrerich
@EgonFrerich
Florian Wilhelm, thanks! My description of the error is not precise. The problem is - I assume - cookiecutter uses jinja-templates to create the project. cookiecutter doesn't use django-admin start project. If I use cookiecutter directly there is no error.
EgonFrerich
@EgonFrerich
If I start pyscaffold with the cookie-template and pyscaffold executes the command django-admin startproject django checks the internal cookiecutter template and doesn't know 'raw'.
EgonFrerich
@EgonFrerich
I just tried the project again. And now it works. I did it with the original pyscaffold. But now I installed it with [All].
Thanks again!
Shravankumar
@shravankumar147
Hi
pyscaffold putup is creating README and other files in .rst format, what if I want to generate in .md format
Florian Wilhelm
@FlorianWilhelm
Hi there, rst is the preferred format in the Python community. It is used in Sphinx and many other projects. Personally, I like md more but PyScaffold is about giving you something really standard and compliant. If you want something more custom-tailored you could use cookiecutter.
@shravankumar147 Would you then also use markdown support in Sphinx?
Thijs Damsma
@tdamsma
Is it possible to modify the test entry points? I need to run py.test twice with different settings, but i want to do that with a single python setup.py test
Florian Wilhelm
@FlorianWilhelm
Have you considered using tox for that instead?
Thijs Damsma
@tdamsma
no, I haven't. I just tried to look at what exactly is the command that python setup.py test executes and couldn't really find how and where it is implemented. Is this something I can override in the setup.cfg?
Florian Wilhelm
@FlorianWilhelm
The code is in the file pyscaffold/pytest_runner.py and this actually only wraps pytest. You can provide additional options to pytest using python setup.py test --addopt .... (this is what you get if you type python setup.py test -h. If you want to run some tests twice with varying parameters, I would really recommend tox which plays nicely together with py.test.
Thijs Damsma
@tdamsma
ok, thanks!
Florian Finkernagel
@TyberiusPrime
Hello, I'd like to source my version-information from setup.cfg for a project instead of the SCM, but keep the rest of the pyscaffold goodness. Alas I can't find a configuration option to turn it of :(.
(I also opened a feature request for this (github.com/pyscaffold/pyscaffold/issues/232) though github is wonky right now)
Florian Finkernagel
@TyberiusPrime
I though I could hack something together by overwriting git_describe_command and grep - but that's not been released yet.
Florian Finkernagel
@TyberiusPrime
'just' hooking 'setup.py --version' in setup.py doesn't work either, since the egg-info will contain the wrong version...
Florian Finkernagel
@TyberiusPrime
ok, I have a (horrible) workaround :)