Coder Social home page Coder Social logo

Add setup.py and publish on pypi about ydiff HOT 36 CLOSED

ymattw avatar ymattw commented on August 22, 2024
Add setup.py and publish on pypi

from ydiff.

Comments (36)

ymattw avatar ymattw commented on August 22, 2024

I will back to this when other known problem get fixed.

from ydiff.

shimont avatar shimont commented on August 22, 2024

are you looking for contributes to this project?
what would you want the setup.py to do?

from ydiff.

jan-matejka avatar jan-matejka commented on August 22, 2024

I'd like it just to provide setup.py install propely and Something for publishing to pypi but there I don't know what Something is yet

from ydiff.

shimont avatar shimont commented on August 22, 2024

ok, ive created a setup.py script and added the project to pypi
http://pypi.python.org/pypi?:action=display&name=cdiff&version=0.0.1

from ydiff.

jan-matejka avatar jan-matejka commented on August 22, 2024
  1. I'm not sure if it is a good idea to publish on pypi if you aren't the author
  2. setup.py is missing license declaration
  3. have you actually tried to install it from pypi? It doesn't work for me. I suspect the reason is missin python versions support declarations
  4. README formatting on pypi is broken
  5. README needs updating of the installation section

from ydiff.

shimont avatar shimont commented on August 22, 2024
  1. no problems, i will remove the package and let you publish it as author.
  2. added licence
  3. i tried installing via "sudo python setup.py install" it is working for me.
  4. removing pypi for you to add
  5. will update README installation section

You should make a .tar.gz file for PyPi to work/

from ydiff.

shimont avatar shimont commented on August 22, 2024

done, i submitted a pull request with all my changes

from ydiff.

jan-matejka avatar jan-matejka commented on August 22, 2024
  1. I DONT know if this is an issue. I have never done this before and don't know much about pypi publishing. I just see there a potential for issues and it doesnt feel kosher to me atm.
  2. so you tested it install via setup.py directly but not if it can be installed from pypi directly with eg. pip
  3. I'm not the author either

from ydiff.

shimont avatar shimont commented on August 22, 2024

i removed the package from PyPi,
there was problem with the package because it was a direct URL to github,
it should be a .tar.gz file.
as far as i understand.. :)

in setup.py
url = "https://github.com/ymattw/cdiff" <--- should be a link to a .tar.gz file

from ydiff.

jan-matejka avatar jan-matejka commented on August 22, 2024
  1. How did you figured it's GPL2? I don't see it.

EDIT: D'oh, the COPYING file.

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

Thank you all for your kind support, I am in UTC+8 timezone so might not
able to response timely.

Sure I will publish to pypi, contributes are very welcome of course. In my
mind publishing to pypi requires this project to be in high quality, means
I need to write more tests and document to get ready to take patch from
more contributors fast.

@microto, I reviewed your changes and think I need to keep the curl option
in the installation part as using pip make things more complex at current
stage, also sudo setup.py is not a good practice according to official pypi
guide. I am reviewing other PRs and will get back to your pull request
soon.

@yaccz, I have a COPYING file for GPLv2 in the repo, I am fine to change to
another (e.g. Apache?) if it make everyone more comfortable to reuse, any
suggestion?

Thanks,
Matt

On Sun, Feb 3, 2013 at 1:48 AM, yaccz [email protected] wrote:

  1. How did you figured it's GPL2? I don't see it.


    Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-13034281.

from ydiff.

jan-matejka avatar jan-matejka commented on August 22, 2024

@ymattw I prefer BSD-3 because it is short, simple and fits my FLOSS projects. I don't like GPL2 because it is sooo long, boring and parts are more of an agitation, and howto instead of a license. I have never actually read the GPL2 but I don't get the point of eg. clause 2.a

I'd also suggest semver.org If you don't know about it yet.

If you plan to postpone publishing on pypi it would be nice to at least have the setup.py and release/<version> tagged commits

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

Thanks for the info, I will look into BSD-3 soon, sorry babysitting today :)

On Sunday, February 3, 2013, yaccz wrote:

@ymattw https://github.com/ymattw I prefer BSD-3 because it is short,
simple and fits my FLOSS projects. I don't like GPL2 because it is sooo
long, boring and parts are more of an agitation, and howto instead of a
license. I have never actually read the GPL2 but I don't get the point of
eg. clause 2.a

I'd also suggest semver.org If you don't know about it yet.

If you plan to postpone publishing on pypi it would be nice to at least
have the setup.py and release/ tagged commits


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-13040543.

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

Guys I have added a setup.py but get 403 response on setup.py register, might this because @microto uploaded one before? Could you help review commit 98f63f6? Thanks.

~/ws/cdiff (master)$ ./setup.py register 
running register
running egg_info
writing cdiff.egg-info/PKG-INFO
writing top-level names to cdiff.egg-info/top_level.txt
writing dependency_links to cdiff.egg-info/dependency_links.txt
writing entry points to cdiff.egg-info/entry_points.txt
reading manifest file 'cdiff.egg-info/SOURCES.txt'
writing manifest file 'cdiff.egg-info/SOURCES.txt'
running check
We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: 
1
Username: ymattw
Password: 
Registering cdiff to http://pypi.python.org/pypi
Server response (403): You are not allowed to store 'cdiff' package information

from ydiff.

myint avatar myint commented on August 22, 2024

It might be due to the previous registration. Just to isolate the issue, try temporarily registering under some fake name.

In any case, you can install directly from the git repository:

$ pip install git+https://github.com/ymattw/cdiff

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

Good point, I will update readme and try your suggestion tomorrow, offline
now, thanks.

On Sunday, February 3, 2013, Steven Myint wrote:

It might be due to the previous registration. Just to isolate the issue,
try temporarily registering under some fake name.

In any case, you can install directly from the git repository:

$ pip install git+https://github.com/ymattw/cdiff


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-13048687.

from ydiff.

myint avatar myint commented on August 22, 2024

By the way, I get a similar error as you when I try registering against some arbitrary existing package. @microto could transfer the cdiff registration to you. (This assumes he can undelete his deletion.)

from ydiff.

jan-matejka avatar jan-matejka commented on August 22, 2024

@myint

In any case, you can install directly from the git repository:

That's quite useless for proper packaging

from ydiff.

myint avatar myint commented on August 22, 2024

What do you mean by proper packaging? The above command is just a convenience that allows users to install from arbitrary repositories instead of manually cloning and running setup.py.

from ydiff.

jan-matejka avatar jan-matejka commented on August 22, 2024

I mean distribution package management system. Every PMS from language I have seen (be ruby, python, node, …) sucks big time.

from ydiff.

shimont avatar shimont commented on August 22, 2024

what should i do? i removed the cdiff project from pypi
is there anything else i should do?

from ydiff.

myint avatar myint commented on August 22, 2024

@microto, to fix this first register it again. Since only you have permission to it currently.

./setup.py register

Then log in to your account on https://pypi.python.org. Go to the cdiff link in your account. Then go to the "Administer the Role assigned to users for this package" link and assign @ymattw as the owner. (You'll have to find out what his username is first.)

from ydiff.

shimont avatar shimont commented on August 22, 2024

done. :)

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

Thanks, register succeeded. I will upload to pypi soon once some document stuff done.

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

Hey, anyone know how to write the setup.py to allow install as a module instead of a package and use entry point like this:

    entry_points = {
    'console_scripts': [
        'cdiff = cdiff:main',
    ],
},

I only see a packages = ['src'] option but this will install it as a package named src, I don't want to rename src to cdiff or even manage it as a package, I want to keep it simple as just 1 script. So is there a modules = instruction?

from ydiff.

myint avatar myint commented on August 22, 2024

I'm not sure. Python users typically put top-level modules in the root of the repository next to the setup.py.

from ydiff.

jan-matejka avatar jan-matejka commented on August 22, 2024

maybe http://docs.python.org/2/distutils/setupscript.html#installing-scripts
also see the 2.6 right below

from ydiff.

myint avatar myint commented on August 22, 2024

That would work. Note that this makes it just an executable script rather than also being an importable module (which is probably fine). Also note that if you choose that route, you can just use distutils, which is built into Python, rather than third-party setuptools.

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

Thanks, finally this syntax make it install as a importable module with a standalone tool ...

    package_dir = {'': 'src'},
    packages = [''],
    py_modules = ['cdiff'],
    scripts = [],
    entry_points = {
        'console_scripts': [
            'cdiff = cdiff:main',
        ],
    },

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

I committed above change (forget to refer to issue), now I want to reduce use of 3rd party setuptools but found setup from distutils.core does not support entry_points at all. I can use scripts = ['src/cdiff.py'] but still not perfect, still looking for a workaround to strip the '.py' extension while install as a standalone script.

Warning: Unknown distribution option: 'entry_points'

from ydiff.

myint avatar myint commented on August 22, 2024

One option is to create a symlink and point distutils to the symlink (only).

from ydiff.

myint avatar myint commented on August 22, 2024

Another option is to forgo the entry_points stuff and create a separate executable that just imports cdiff and runs cdiff.main().

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

I prefer to symlink so that it also works if someone download the src/cdiff directly.

from ydiff.

ymattw avatar ymattw commented on August 22, 2024
$ pip install cdiff -r http://testpypi.python.org/pypi
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/pip-1.2.1-py2.6.egg/pip/basecommand.py", line 107, in main
    status = self.run(options, args)
  File "/Library/Python/2.6/site-packages/pip-1.2.1-py2.6.egg/pip/commands/install.py", line 230, in run
    for req in parse_requirements(filename, finder=finder, options=options):
  File "/Library/Python/2.6/site-packages/pip-1.2.1-py2.6.egg/pip/req.py", line 1330, in parse_requirements
    req = InstallRequirement.from_line(line, comes_from)
  File "/Library/Python/2.6/site-packages/pip-1.2.1-py2.6.egg/pip/req.py", line 118, in from_line
    return cls(req, comes_from, url=url)
  File "/Library/Python/2.6/site-packages/pip-1.2.1-py2.6.egg/pip/req.py", line 43, in __init__
    req = pkg_resources.Requirement.parse(req)
  File "/Library/Python/2.6/site-packages/distribute-0.6.34-py2.6.egg/pkg_resources.py", line 2678, in parse
    reqs = list(parse_requirements(s))
  File "/Library/Python/2.6/site-packages/distribute-0.6.34-py2.6.egg/pkg_resources.py", line 2591, in parse_requirements
    raise ValueError("Missing distribution spec", line)
ValueError: ('Missing distribution spec', '<?xml version="1.0" encoding="utf-8"?>')

Storing complete log in /Users/ymattw/Library/Logs/pip.log

from ydiff.

ymattw avatar ymattw commented on August 22, 2024

Ok... testpypi sucks. I uploaded to pypi and pip install cdiff works. I am going to close this, I am still missing a ChangeLog, better versioning and install/uninstall, but keep them later.

Thanks all for your kind support!

~/ws/cdiff (master)$ sudo pip install cdiff 
Password:
Downloading/unpacking cdiff
  Downloading cdiff-0.0.1.tar.gz
  Running setup.py egg_info for package cdiff
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py
Installing collected packages: cdiff
  Running setup.py install for cdiff
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py
    changing mode of build/scripts-2.6/cdiff from 644 to 755
    changing mode of /usr/local/bin/cdiff to 755
Successfully installed cdiff
Cleaning up...
~/ws/cdiff (master)$ which cdiff
/usr/local/bin/cdiff

from ydiff.

jan-matejka avatar jan-matejka commented on August 22, 2024

Kudos & thanks

from ydiff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.