Code Monkey home page Code Monkey logo

Comments (28)

dgasmith avatar dgasmith commented on July 23, 2024 1

BTW @avirshup checkout the cookie cutter here. That has conda-build tech natively there, its reasonably straightforward for pure Python projects.

from geometric.

avirshup avatar avirshup commented on July 23, 2024 1

Oh, I think this is because you've moved on past the commit you originally tagged. Because your latest commit isn't tagged, it isn't getting a nice, parseable version number.

To fix this, you can either

  1. Delete your original "0.8" tag and re-apply it to the latest commit, or
  2. Just tag the latest commit with "0.8.1" (or 0.8.1b1 or 08.1rc1 etc. - pep440 provides some guidance on this)

from geometric.

dgasmith avatar dgasmith commented on July 23, 2024

Hopefully not speaking for Leeping, but we will need them on PyPi/conda for a new database project that we are working on. We will get them up on the web sooner rather than later.

from geometric.

leeping avatar leeping commented on July 23, 2024

Hello Aaron and Daniel,

I'm definitely interested in packaging and making this easy to install on both PyPI and conda. :)

from geometric.

avirshup avatar avirshup commented on July 23, 2024

Great! It looks like the packaging is already pretty well taken care of, but please ping me if can help with anything along these lines

from geometric.

leeping avatar leeping commented on July 23, 2024

We've been working on fitting everything into a cookiecutter template (@yudongqiu did all of this). I don't know what's involved in listing a package on PyPI. I could figure this out myself but any time-saving pointers would be very helpful.

from geometric.

avirshup avatar avirshup commented on July 23, 2024

So, here's my current practices:

  1. Install versioneer into your project. After that, all you need to do to create a "release" is just git tag the relevant commit with your chosen version number.
  2. Register for an account at pypi
  3. Set up travis to deploy to pypi when you tag a commit

Conda and I still aren't friends, I'd defer to @dgasmith on that.

from geometric.

leeping avatar leeping commented on July 23, 2024

Thanks a lot. @yudongqiu : Have we installed versioneer into our project, or do we plan to?

from geometric.

avirshup avatar avirshup commented on July 23, 2024

And actually, I can just send you a PR for step 1 and 3 if you like

Edited to add: there are many other ways of setting up versioning, I personally have found versioneer to be the most foolproof

from geometric.

leeping avatar leeping commented on July 23, 2024

Thanks, I've created the PyPI account (username is leeping). :)

from geometric.

leeping avatar leeping commented on July 23, 2024

Shall we make the current version "release 1.0"?

from geometric.

avirshup avatar avirshup commented on July 23, 2024

OK, created a PR - #14 - for versioneer (that's the easy part).

from geometric.

leeping avatar leeping commented on July 23, 2024

Sorry, I got confused regarding the cookiecutter - we did that for a different but related project! It is also planned for this project.

from geometric.

yudongqiu avatar yudongqiu commented on July 23, 2024

@leeping Yes, versioneer is included in the cookiecutter template which is adopted by the our crank project. https://github.com/lpwgroup/crank

from geometric.

leeping avatar leeping commented on July 23, 2024

I've tagged the current release as 0.8.

from geometric.

leeping avatar leeping commented on July 23, 2024

Any thoughts on why it's better to set up Travis to deploy, rather than using the command python setup.py register sdist upload?

from geometric.

leeping avatar leeping commented on July 23, 2024

Deploying Travis on PyPI requires adding my encrypted PyPI password to .travis.yml which in turn requires the Travis CLI, which is a Ruby gem. Attempting to install the gem failed on my system with the message:

Fetching: multipart-post-2.0.0.gem (100%)
Successfully installed multipart-post-2.0.0
Fetching: faraday-0.14.0.gem (100%)
Successfully installed faraday-0.14.0
Fetching: faraday_middleware-0.12.2.gem (100%)
Successfully installed faraday_middleware-0.12.2
Fetching: highline-1.7.10.gem (100%)
Successfully installed highline-1.7.10
Fetching: backports-3.11.1.gem (100%)
Successfully installed backports-3.11.1
Fetching: multi_json-1.13.1.gem (100%)
Successfully installed multi_json-1.13.1
Fetching: addressable-2.4.0.gem (100%)
Successfully installed addressable-2.4.0
Fetching: net-http-persistent-2.9.4.gem (100%)
Successfully installed net-http-persistent-2.9.4
Fetching: net-http-pipeline-1.0.1.gem (100%)
Successfully installed net-http-pipeline-1.0.1
Fetching: gh-0.15.1.gem (100%)
Successfully installed gh-0.15.1
Fetching: launchy-2.4.3.gem (100%)
Successfully installed launchy-2.4.3
Fetching: ffi-1.9.23.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing travis:
	ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.23/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20180404-24006-1sa6pvf.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/ffi-1.9.23 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.23/gem_make.out

from geometric.

leeping avatar leeping commented on July 23, 2024

Fixed it (had to apt-get install ruby-dev)

from geometric.

avirshup avatar avirshup commented on July 23, 2024

Best practice is to do the upload from travis because it guarantees that you're uploading the same artifact that you tested. Otherwise, it's surprisingly easy to upload the wrong thing (speaking from experience)

That said, I've always found travis to be a royal pain, and have often just done it manually anyways.

In that case, I'd recommend using twine to upload, which is much more secure than python setup.py upload. The procedure there is

pip install twine  # install twine if necessary
python setup.py sdist  # create the sdist
twine upload dist/[your package name].tar.gz -u [pypi username] -p [pypi password]

from geometric.

leeping avatar leeping commented on July 23, 2024

Thanks a lot, the tests are running now. I hope the password encryption worked.

from geometric.

leeping avatar leeping commented on July 23, 2024

The password encryption did work, but the deployment command was not running in the right folder.. trying again

from geometric.

leeping avatar leeping commented on July 23, 2024

Okay, here's the current error message. I'm about to head into a meeting and will revisit later today.

Uploading geometric-0.8+2.g1f636f3.tar.gz

  0% 0.00/124k [00:00<?, ?B/s]
100% 124k/124k [00:00<00:00, 452kB/s]
HTTPError: 400 Client Error: '0.8+2.g1f636f3' is an invalid value for Version. Error: Cannot use PEP 440 local versions. see https://packaging.python.org/specifications/core-metadata for url: https://upload.pypi.org/legacy/

travis_fold:end:dpl.3
__pycache__/versioneer.cpython-36.pyc already exists, no checkout
geometric.egg-info/PKG-INFO already exists, no checkout
geometric.egg-info/SOURCES.txt already exists, no checkout
geometric.egg-info/dependency_links.txt already exists, no checkout
geometric.egg-info/entry_points.txt already exists, no checkout
geometric.egg-info/requires.txt already exists, no checkout
geometric.egg-info/top_level.txt already exists, no checkout
Could not restore untracked files from stash entry
PyPI upload failed.
failed to deploy```

from geometric.

leeping avatar leeping commented on July 23, 2024

I think the main error message is Error: Cannot use PEP 440 local versions

from geometric.

leeping avatar leeping commented on July 23, 2024

The error message is now:

Skipping a deployment with the pypi provider because this branch is not permitted

from geometric.

leeping avatar leeping commented on July 23, 2024

Any idea why this error is appearing? I thought we were on the master branch.

from geometric.

leeping avatar leeping commented on July 23, 2024

All right, the error is now: The user 'leeping' is not allowed to upload to project 'geometric'.. I think that's because the module name on PyPI is taken. Could we change the package name on PyPI without changing the name of the GitHub repository?

from geometric.

leeping avatar leeping commented on July 23, 2024

We wrote a nice letter to the owner of the geometric package on PyPI and he has agreed to transfer the package ownership to us. Version 0.8.6 is now live!

from geometric.

leeping avatar leeping commented on July 23, 2024

The remaining question is whether we should automate releases from Travis or do them manually. I have heard arguments in favor of both options.

from geometric.

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.