scheinerman / Permutations.jl

Permutations class for Julia.
Other
51 stars 14 forks source link

update the package manager version #6

Closed my-little-repository closed 7 years ago

my-little-repository commented 7 years ago

I am using julia v0.5.0. and I pulled Permutations.jl with the package manager.

 julia> using Permutations
  julia>  a = [4,1,3,2,6,5];
  julia> p = Permutation(a)
  ERROR: Improper array: must be a permutation of 1:n
   in Permutations.Permutation(::Array{Int64,1}) at /home/harven/.julia/v0.5/Permutations/src/Permutations.jl:20

The error does not appear in the master version. It looks like that an ancient version of Permutations, whichi is not compatible with julia 0.5, is bundled with the package manager. Is it possible to upgrade the version provided by the package manager? Thanks.

scheinerman commented 7 years ago

Thanks for writing. I am quite confused by all matters GIT so I’m not entirely sure how to do this. Is there a command in Julia I need to give? Any help you can render would be most appreciated!!

On Oct 10, 2016, at 12:41, my-little-repository notifications@github.com<mailto:notifications@github.com> wrote:

I am using julia v0.5.0. and I pulled Permutations.jl with the package manager.

julia> using Permutations julia> a = [4,1,3,2,6,5]; julia> p = Permutation(a) ERROR: Improper array: must be a permutation of 1:n in Permutations.Permutation(::Array{Int64,1}) at /home/harven/.julia/v0.5/Permutations/src/Permutations.jl:20

The error does not appear in the master version. It looks like that an ancient version of Permutations, whichi is not compatible with julia 0.5, is bundled with the package manager. Is it possible to upgrade the version provided by the package manager? Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/scheinerman/Permutations.jl/issues/6, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHIqzsusV-14oXTK6Y7Q7RuBZTj7xzUlks5qymqygaJpZM4KSw16.

Edward R. Scheinerman Vice Dean for Education / Professor of Applied Mathematics & Statistics Whiting School of Engineering The Johns Hopkins University 3400 North Charles Street Baltimore, Maryland 21218 USA

Email: ers@jhu.edumailto:ers@jhu.edu Web: http://www.ams.jhu.edu/ers Phone: +1-410-516-7210 (office) +1-410-428-5053 (mobile/text) Appointments: Missy Kirby +1-410-516-7395 or missy.kirby@jhu.edumailto:missy.kirby@jhu.edu Office: Shaffer 103, Homewood Campus

my-little-repository commented 7 years ago

Thanks for your answer. Unfortunately, I am just an end user who don't know much about the package manager and git... I would suggest to ask for some advice on the julia-users mailing list, there are many nice people there that are always eager to help.

kalmarek commented 7 years ago

I've just hit that as well.

You (as a maintainer/owner) need to

PkgDev.tag("Permutations")
PkgDev.publish()

have a look at manual

my-little-repository commented 7 years ago

I just upgraded to julia v0.6 and installed Permutations v 0.0.1. I get the same error again.

  julia> p = Permutation(a)
  ERROR: Improper array: must be a permutation of 1:n
  Stacktrace:
   [1] Permutations.Permutation(::Array{Int64,1}) at /home/yves/.julia/v0.6/Permutations/src/Permutations.jl:20

Is it possible to upgrade the version provided by the package manager? Thanks.

scheinerman commented 7 years ago

I'll try to get on this. A lot of my code breaks or generates so many warnings in Julia 0.6 that I've avoided upgrading for now. If you can help me pinpoint the issue I'd appreciate it. I'd especially like a fix that works in both 0.5 and 0.6.

scheinerman commented 7 years ago

I checked the code on GitHub and it works in Julia 0.6. I think the problem is I really don't know how to use the package manager. If you install like this:

Pkg.clone("https://github.com/scheinerman/Permutations.jl.git")

instead of using Pkg.add I think you'll be fine. Please let me know.

kalmarek commented 7 years ago

the simplest fix (on the user side) for this particular issue is to doPkg.checkout("Permutations"); to tag and publish new version have a look at https://docs.julialang.org/en/stable/manual/packages/#Tagging-and-Publishing-Your-Package-1 (it's just two commands).

BTW I authored/reworked permutations functionality in https://github.com/Nemocas/Nemo.jl You may or may not find it useful

scheinerman commented 7 years ago

OK. I did these commands:

Pkg.checkout("Permutations")
PkgDev.submit("Permutations")

I hope (a) that was the right thing to do and (b) it worked :-)

my-little-repository commented 7 years ago

It didn't work for me. I guess that the two commands needed are

PkgDev.tag("Permutations")
PkgDev.publish()

The PkgDev.tag() command takes an optional second argument that is either an explicit version number object like v"0.0.1" or one of the symbols :patch, :minor or :major. These increment the patch, minor or major version number of your package intelligently.

scheinerman commented 7 years ago

I'm so sorry, but I can't make this work. Is there a way to "deregister" and start over? My advice is just to do a Pkg.clone and I regret ever using the "publish" system. When working in Julia I at least have the illusion I understand what's going on. But the package management/GIT world has me completely flustered.

rdeits commented 7 years ago

@scheinerman I would suggest you take a look at Attobot which is a tool designed specifically to make publishing new versions of Julia packages easier. Once you have set up Attobot (from the instructions on that page), rather than going through the PkgDev.submit() process, you just:

  1. Create a "release" on github from here: https://github.com/scheinerman/Permutations.jl/releases when you're happy with the current state of your master branch
  2. There is no step 2
scheinerman commented 7 years ago

OK. I tried this and deleted the old releases. I hope this worked! I still think using Pkg.clone is easier.

scheinerman commented 7 years ago

This is frustrating. I tagged the new version as 0.1.0. I wiped out my ~/.julia/v0.6 and did Pkg.add("Permutations") and yet it reports this:

julia> Pkg.add("Permutations")
INFO: Installing Permutations v0.0.1
INFO: Package database updated

and the old version (that has errors) is installed.

rdeits commented 7 years ago

You created the release correctly (although it wasn't necessary to delete the old releases), but the release won't be available for download until your new tag is accepted by the Julia package maintainers. That happens when this pull request gets merged: https://github.com/JuliaLang/METADATA.jl/pull/10906 (sorry, I guess there was a step 2, but it's just "wait for the pull request to be approved). That usually happens within 12-24 hours.

tkelman commented 7 years ago

Can you enable Travis CI here?

scheinerman commented 7 years ago

OK. Thanks. I’ll give it a day and see what happens.

On Aug 24, 2017, at 20:37, Robin Deits notifications@github.com<mailto:notifications@github.com> wrote:

You created the release correctly (although it wasn't necessary to delete the old releases), but the release won't be available for download until your new tag is accepted by the Julia package maintainers. That happens when this pull request gets merged: JuliaLang/METADATA.jl#10906https://github.com/JuliaLang/METADATA.jl/pull/10906 (sorry, I guess there was a step 2, but it's just "wait for the pull request to be approved). That usually happens within 12-24 hours.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/scheinerman/Permutations.jl/issues/6#issuecomment-324793472, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHIqzksWrRoF0D82NdFl26_lYXsXuU3Hks5sbhcrgaJpZM4KSw16.

scheinerman commented 7 years ago

I don’t know what “Travis CI” is … happy to do it but need complete instructions please.

On Aug 25, 2017, at 00:26, Tony Kelman notifications@github.com<mailto:notifications@github.com> wrote:

Can you enable Travis CI here?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/scheinerman/Permutations.jl/issues/6#issuecomment-324820794, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHIqzhcNXiYGQoiOAQGflixve6xU-o0Qks5sbkz_gaJpZM4KSw16.

rdeits commented 7 years ago

Travis is a service that automatically runs the tests for your a software package (typically whenever you push to master or whenever someone opens a pull request). It's universally used in the Julia community (and for lots of other languages) as a way to independently verify that a package is working. It's also free for open-source projects and integrates well with github (once you've turned it on, it will automatically detect github pull requests and tell you ahead of time whether your tests will pass if you merge that pull request).

The instructions to get started are here: https://docs.travis-ci.com/user/getting-started/ . Travis is configured by placing a single file named .travis.yml in the top level of your repository. The following configuration file should work (I copied it from PkgDev.jl):

## Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia
os:
  - linux
  - osx
julia:
  - 0.5
  - 0.6
  - nightly
notifications:
  email: false
git:
  depth: 99999999
## uncomment the following lines to allow failures on nightly julia
## (tests will run but not make your overall status red)
#matrix:
#  allow_failures:
#  - julia: nightly
## uncomment and modify the following lines to manually install system packages
#addons:
#  apt: # apt-get for linux
#    packages:
#    - gfortran
#before_script: # homebrew for mac
#  - if [ \$TRAVIS_OS_NAME = osx ]; then brew install gcc; fi
## uncomment the following lines to override the default test script
#script:
#  - julia -e 'Pkg.clone(pwd()); Pkg.build("$pkg_name"); Pkg.test("$pkg_name"; coverage=true)'
after_success:
  # push coverage results to Coveralls
  - julia -e 'cd(Pkg.dir("$pkg_name")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
  # push coverage results to Codecov
  - julia -e 'cd(Pkg.dir("$pkg_name")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
scheinerman commented 7 years ago

Thanks. I had a .travis.yml file, but have updated it using the code you sent.

tkelman commented 7 years ago

Did you also enable it at https://travis-ci.org/scheinerman/Permutations.jl ?

scheinerman commented 7 years ago

No. I didn’t know about this! Gack this is involved.

I activated a Travis account but have no idea what to do there. I'm getting close to giving up on all this ...

On Aug 28, 2017, at 12:50 PM, Tony Kelman notifications@github.com<mailto:notifications@github.com> wrote:

Did you also enable it at https://travis-ci.org/scheinerman/Permutations.jl ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/scheinerman/Permutations.jl/issues/6#issuecomment-325409197, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHIqzuEUZ4CQgZDe70PWzSV1GbXX0taYks5scu_UgaJpZM4KSw16.

tkelman commented 7 years ago

I think, if you're logged in to travis and follow that link, there should be a fairly obvious "activate repository" button you can click

scheinerman commented 7 years ago

It passed tests on Travis, but Julia is still loading an old version with Pkg.add. I have no clue what to do.

tkelman commented 7 years ago

Sorry, https://github.com/JuliaLang/METADATA.jl/pull/10919 was causing some issues with JuliaCIBot so I hadn't merged it yet. Since you don't have any reverse-dependencies it's fine. Should work now after a Pkg.update().

my-little-repository commented 7 years ago

It worked. Thanks.

  julia> using Permutations
 julia>  a = [4,1,3,2,6,5];
 julia> p = Permutation(a)
 (1,4,2)(3)(5,6)