Giter VIP home page Giter VIP logo

opam-publish's Introduction

opam-publish

A tool to ease contributions to opam repositories.

opam-publish takes package definition files of your projects, and submits them to opam package repositories (ocaml/opam-repository by default).

Prerequisites

This version is for opam 2.0 or higher, and should not be used with repositories in older formats. A Github account is required. opam repository is cloned over ssh, you need to have your ssh keys registered in your Github account.

Usage

Basic case, assuming your project is on Github

The same works for initial publications, new releases, and updates.

The following should be run from the source directory of your project

  1. Make sure you have an opam file, or NAME.opam files at the root of your project
  2. Create a tag: git tag -a TAG; git push origin TAG
  3. Run opam publish. This will install the tool if required.

You will be guided through the rest (creating a Github token the first time, reviewing the patch, etc.)

Additional possibilities

If your project is not on Github, you can specify the archive URL on the command-line.

If the opam files are not in the archive, or outdated, you can specify them on the command-line, or specify a directory where to look for them (e.g. opam publish URL .).

Submitting to other repositories is possible, as long as they are on Github. See the --repo option.

Updating already published packages using opam-publish is generally prohibited as it usually implies a change in the target archive via the git tag, which would break everyone trying to install the package. Please refer to opam-repository's documentation for more informations about how to update or fix packages.

See opam publish --help for more options.

opam-publish's People

Contributors

aaylor avatar altgr avatar avsm avatar chris00 avatar dsheets avatar favonia avatar fpottier avatar ilankri avatar k4rtik avatar kit-ty-kate avatar liyishuai avatar phated avatar rikusilvola avatar rjbou avatar samoht avatar struktured avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opam-publish's Issues

Github 1.0 Compatible Release

Can we release a version compatible with github 1.0? Would make it easier for unsuspecting users as the current version of opam publish ends up trying to downgrade cohttp for everyone.

confusing worklow

I managed to get my first PR with opam-publish, yay!

Few things are confusing:

  • the tool complain if you have extra files in the dir (such as descr~), which is annoying

  • the tool complain if you don't have a long description (it might happen)

  • the tool ask me for my host password. Which password is that? Would be useful to know why it needs it.

  • Finally, as I didn't enter the password (didn't know which one it wanted exactly), I got the following output:

    thomas@piana:~/git/mirage-console$ opam publish submit mirage-console.2.0.0
    [2.0.0.tar.gz] Downloading https://github.com/mirage/mirage-console/archive/2.0.0.tar.gz
    Enter host password for user 'samoht':
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
    100   274  100    93  100   181    140    272 --:--:-- --:--:-- --:--:--   273
    Pull-requested: https://github.com/ocaml/opam-repository/pulls
    

    which is not very helpful. I had to go to my fork to create the pull request manually.

broken state

Just installed master and everything seems broken.

$ opam-publish repo list
Fatal error:
# opam-version    1.2.0 (41d8d7a97a5182846e1b98f62de3210e41387f18)
# os              darwin
opam-publish: "waitpid" failed: Interrupted system call
$ opam-publish prepare mirage-fs-unix.1.1.2 https://github.com/mirage/mirage-fs-unix/archive/1.1.2.tar.gz
[1.1.2.tar.gz] Downloading https://github.com/mirage/mirage-fs-unix/archive/1.1.2.tar.gz
[ERROR] https://github.com/mirage/mirage-fs-unix/archive/1.1.2.tar.gz is not available: https://github.com/mirage/mirage-fs-unix/archive/1.1.2.tar.gz

Maybe I need to cleanup some state somewhere?

add the list of changes to the PR

This is kind of a complex feature request, but that would be great if we could have the list of changes displayed in the description of the PR. A possible idea on how to do that:

  • look at the root of the archive for CHANGES, CHANGES.txt or CHANGES.md
  • diff the file with the previous released version
  • add the new entries in the PR description

opam-publish fails with OpamSystem.Process_error

opam-publish 0.3.4 fails with Process_error and is not helpful (gives no useful information).

I am probably to blame for the Process_error, but opam-publish should give more detailed information.

How to reproduce:
git clone https://github.com/lebotlan/ocaml-cryptodbm.git
cd ocaml-cryptodbm/
opam-publish prepare cryptodbm-v0.82.0 https://github.com/lebotlan/ocaml-cryptodbm/archive/cryptodbm-v0.82.0.tar.gz

(By the way, I am not sure this is the canonical way to publish... any advice will be appreciated).

The above command gives :
[cryptodbm-v0.82.0.tar.gz] https://github.com/lebotlan/ocaml-cryptodbm/archive/cryptodbm-v0.82.0.tar.gz downloaded
OpamSystem.Process_error(_)
Backtrace:
Raised at file "map.ml", line 122, characters 10-25
Called from file "src0/sexp_conv.ml", line 149, characters 10-37

Strangely enough, it succeeded this morning with another package (exenum), but seems to fail now.

opam-publish fails for GitHub complaining about JSON formats

With COHTTP_DEBUG I saw

$ COHTTP_DEBUG=1 opam-publish submit bamboo.0.0.01
<...snip...>
>>> POST /authorizations HTTP/1.1
>>> accept: application/vnd.github.v3+json
authorization: Basic cGlyYXBpcmE6Y3Awb2RrSzY=
content-length: 62
host: api.github.com
user-agent: ocaml-github ocaml-cohttp/0.21.1
x-github-otp: 222877
>>> {"scopes":[<"repo">],"note":"opam-publish access token (sri)"}
HTTP Error 400 Bad Request
Headers:
<snip>
content-length: 138
<snip>

Body:
{"message":"Problems parsing JSON","documentation_url":"https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization"}

This happens on opam-publish 0.3.5, atd 1.12.0, github 3.0.0 and github-unix 3.0.0 with OCaml 4.04.1.

To me [<"repo">] looks not familiar as JSON.

Fatal error: Ssl not available

The error Fatal error: Ssl not available should be caught and the user should be said what to do — or were to complain! Otherwise, for first time users, this can be quite frustrating.

At the moment the tool does not work without declaring CONDUIT_TLS=native. It may be a good idea to try both SSL implementations before failing.

Help maintainers manage a roll-out with new constraints

From http://lists.ocaml.org/pipermail/opam-devel/2015-June/001129.html:

When you do a release you may have to modifiy the constraints of other packages. How are you suppose to handle this with opam-publish ?

opam-publish could help here by checking dependent packages and prompting the user to check or constrain them. This kind of functionality might then result in a sequence of PRs which would need to be orchestrated by local monitoring or a third-party service.

This is definitely a feature wish.

opam-publish mangles depext.

depexts:[
  [[ "ubuntu"] ["librdmacm-dev" "libibverbs-dev"] ]
]

becomes

depexts: [
  ["ubuntu"]
  ["libibverbs-dev" "librdmacm-dev"]
]

when it's pulled through opam-publish prepare

`opam-publish prepare` URL contents silently overriden by current pin

I follow these steps:

I create a directory opam-publish-test-pinned. In it I place a file opam containing:

opam-version: "1.2"
license: "Sasquatch"
maintainer: "Sasquatch2"
author: "Sasquatch3"
homepage: "http://example.com/Sasquatch4"
bug-reports: "http://example.com/Sasquatch5"
dev-repo: "git+ssh://[email protected]/mcclure/ppx_publish_test.git"

I run:

opam pin add opam-publish-test /Users/mcc/work/h/opam-garbage/opam-publish-test-pinned

This package is now pinned.

I create a new directory, opam-publish-test. In it I place a file opam containing:

opam-version: "1.2"
license: "crunch"
maintainer: "crunch2"
author: "crunch3"
homepage: "http://example.com/crunch4"
bug-reports: "http://example.com/crunch5"
dev-repo: "git+ssh://[email protected]/mcclure/ppx_publish_test.git"

I create a zipfile opam-publish-test-archive.zip of the opam-publish-test directory.

I enter a new, empty directory. I run:

opam-publish prepare opam-publish-test.1.0 /Users/mcc/work/h/opam-garbage/opam-publish-test/opam-publish-test-archive.zip

opam-publish prepare does the thing it does. There is now a directory opam-publish-test.1.0 in the current directory. I run cat opam-publish-test.1.0/opam.

Expected behavior:

I expect that the generated opam file will contain the word "crunch" over and over. This is what I expect based on both intuition from the command I just ran, and on what it says in opam-publish --help ("Provided a remote archive URL, gathers metadata for an OPAM package suitable for editing and submitting to an OPAM repo.")

Observed behavior: the generated opam file contains

opam-version: "1.2"
maintainer: "Sasquatch2"
authors: "Sasquatch3"
homepage: "http://example.com/Sasquatch4"
bug-reports: "http://example.com/Sasquatch5"
license: "Sasquatch"
dev-repo: "git+ssh://[email protected]/mcclure/ppx_publish_test.git"

So it is somehow picking all the content out of the currently pinned "opam-publish-test" package, not the file I directed it at. AltGr on #ocaml freenode looked at the code and highlighted this line of code, which I believe they said says "the archive" has low priority. However, no documentation I can find suggests any data source other than the provided archive URL will be queried at all, much less that some of those data sources are higher priority than the archive URL.

I think you should do one or more of the following:

  • Make the generated opam file grab keys from the provided URL only, to match the current documentation
  • If the current behavior stays, document it in opam-publish --help and the README.
  • If the final behavior is that more than one data source is queried (especially if some of them are implicit), the opam-publish prepare should print out the exact data sources it used to prepare the template along with the other messages it currently prints, so that the user is not surprised.

Overall the current behavior is surprising, it almost caused me to submit an opam file with incorrect information.

Spurious whitespace chars after the version number

I tried to use opam-publish for the first time today, doing:

opam-publish prepare https://github.com/LexiFi/gen_js_api/archive/v1.0.tar.gz

It created a directory gen_js_api.1.0 / (with 3 whitespace chars after the '0'), which I had to rename manually. How does the tool infer the package name and version number?

Linking error during installation

Installation from OPAM fails due to a linking error:

findlib: [WARNING] Interface base64.cmi occurs in several directories: ~/.opam/4.02.0/lib/extlib, ~/.opam/4.02.0/lib/base64
ld: warning: directory not found for option '-Lclient/'
ld: warning: directory not found for option '-Lrepositories/'
ld: warning: directory not found for option '-Lsolver/'
ld: warning: directory not found for option '-Lcore/'
duplicate symbol _camlBase64__data_begin in:
    ~/.opam/4.02.0/lib/extlib/extLib.a(base64.o)
    ~/.opam/4.02.0/lib/base64/base64.a(base64.o)
duplicate symbol _camlBase64__code_begin in:
    ~/.opam/4.02.0/lib/extlib/extLib.a(base64.o)
    ~/.opam/4.02.0/lib/base64/base64.a(base64.o)
duplicate symbol _camlBase64 in:
    ~/.opam/4.02.0/lib/extlib/extLib.a(base64.o)
    ~/.opam/4.02.0/lib/base64/base64.a(base64.o)
duplicate symbol _camlBase64__entry in:
    ~/.opam/4.02.0/lib/extlib/extLib.a(base64.o)
    ~/.opam/4.02.0/lib/base64/base64.a(base64.o)
duplicate symbol _camlBase64__code_end in:
    ~/.opam/4.02.0/lib/extlib/extLib.a(base64.o)

Can't seem to publish, getting permissions

I keep getting these permissions errors trying to publish to opam,

opam-publish submit ./lambda-invaders.1.0
[v1.1.tar.gz] Downloading https://github.com/fxfactorial/lambda-invaders/archive/v1.1.tar.gz
Please enter your github name: fxfactorial
opam-version 1.2.0
os darwin
command git clone [email protected]:ocaml/opam-repository.git /Users/Edgar/.opam/plugins/opam-publish/repos/default
path /Users/Edgar/Repos/lambda-invaders
exit-code 128
env-file /var/folders/31/fdpzgydn611cp5mly2p9hv3c0000gn/T/opam-974/log/log-974-5f1023.env
stdout-file /var/folders/31/fdpzgydn611cp5mly2p9hv3c0000gn/T/opam-974/log/log-974-5f1023.out
stderr-file /var/folders/31/fdpzgydn611cp5mly2p9hv3c0000gn/T/opam-974/log/log-974-5f1023.err
stderr ###
Cloning into '/Users/Edgar/.opam/plugins/opam-publish/repos/default'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

running wget on the url is totally fine, so I'm not sure what's the issue.

Opam publish disappeared.

I used to have a working opam publish, now I don't.

~ ❯❯❯ opam info publish
             package: publish
             version: 0.3.0
          repository: default
        upstream-url: https://github.com/OCamlPro/opam-publish/archive/0.3.0.tar.gz
       upstream-kind: http
   upstream-checksum: e0c500e5fb0918269d729b0575033c48
            homepage: http://opam.ocaml.org
         bug-reports: https://github.com/OCamlPro/opam-publish/issues
            dev-repo: https://github.com/OCamlPro/opam-publish.git
              author: Louis Gesbert <[email protected]>, David Sheets <[email protected]>
             license: LGPL-3.0 with OCaml linking exception
                tags: flags:plugin
             depends: opam-lib = 1.2.2 & ocamlfind & cmdliner & github >= 1.0.0
   installed-version: 0.3.0 [working]
   available-version: 0.3.0
         description: A tool to ease contributions to opam repositories.

Opam-publish helps gather metadata to form an OPAM package and submit it
to a remote repository.

~ ❯❯❯ opam --version
1.2.2
~ ❯❯❯ opam config env
CAML_LD_LIBRARY_PATH="/Users/Edgar/.opam/working/lib/stublibs"; export CAML_LD_LIBRARY_PATH;
OPAMUTF8MSGS="1"; export OPAMUTF8MSGS;
MANPATH=":/Users/Edgar/.opam/working/man"; export MANPATH;
PERL5LIB="/Users/Edgar/.opam/working/lib/perl5:"; export PERL5LIB;
OCAML_TOPLEVEL_PATH="/Users/Edgar/.opam/working/lib/toplevel"; export OCAML_TOPLEVEL_PATH;
PATH="/Users/Edgar/.opam/working/bin:/Users/Edgar/.cabal/bin:/Applications/ghc-7.8.2.app/Contents/bin:/Users/Edgar/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin"; export PATH;
~ ❯❯❯ opam publish
opam: unknown command `publish'.
Usage: opam COMMAND ...
Try `opam --help' for more information.
~ ❯❯❯ opam-publish                                                                                                                                                                 ⏎
zsh: command not found: opam-publish

Infinite loop when `OPAMYES=1`

When I run publish normally, it asks me my username:

 $ opam publish submit ./coclobas.0.0.0
[0.0.0.tar.gz] https://github.com/hammerlab/coclobas/archive/0.0.0.tar.gz downloaded
A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name:

But with OPAMYES it loops forever:

 $ OPAMYES=1 opam publish submit ./coclobas.0.0.0  | head -n 42
[0.0.0.tar.gz] https://github.com/hammerlab/coclobas/archive/0.0.0.tar.gz downloaded
A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

Please enter your GitHub name: A GitHub account is currently required to directly contribute to the official opam repository.
If you don't have a GitHub account, you can create one at https://github.com/join

propose a template opam file when preparing

Would be nice to propose some kind of opam template when there are no template at the root of the archive (same as opam pin ideally).

For instance:

$ opam-publish prepare cass https://github.com/samoht/cass/archive/cass-0.1.0.tar.gz
[cass-0.1.0.tar.gz] Downloading https://github.com/samoht/cass/archive/cass-0.1.0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   123    0   123    0     0    115      0 --:--:--  0:00:01 --:--:--   115
100  8446  100  8446    0     0   4621      0  0:00:01  0:00:01 --:--:--  4621
200
[ERROR] No metadata found

Be less strict

$ opam publish submit git.1.4.5
[ERROR] In /Users/thomas/git/ocaml-git/git.1.4.5/opam:
  - Fields 'depends' and 'depopts' refer to the same package names

[1.4.5.tar.gz] Downloading https://github.com/mirage/ocaml-git/archive/1.4.5.tar.gz
[ERROR] Please correct the above errors and retry

That's actually an error in opam lint, not in my package, but I have no way to work-around it. Would be nice to at least add an option to not try to lint anything (--force or --do-not-lint).

opam submit --msg improvements

So I made my first submissions with the --msg flag. Here are a few issues/improvements

  1. It may be better to put the message contents before, I suspect that's what repo maintainer are more interested in, descrs they get used to it, but maybe ask them.
  2. The message should be somehow escaped so that release notes mentioning issue numbers do not get cross linked into OPAM's repository issue tracker...
  3. The current formatting is a bit broken: the "Pull-request generated by opam-publish v0.3.2" gets appended immediately after the message.

See
ocaml/opam-repository#6794
ocaml/opam-repository#6795
ocaml/opam-repository#6796

Name and version in the root opam file

I don't think that's a good idea to require the root opam file of the archive to contain name and version information:

$ opam-publish prepare uucp http://erratique.ch/software/uucp/releases/uucp-0.9.0.tbz
[uucp-0.9.0.tbz] Downloading http://erratique.ch/software/uucp/releases/uucp-0.9.0.tbz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  334k  100  334k    0     0   976k      0 --:--:-- --:--:-- --:--:--  978k
200
[ERROR] Package version unspecified
$ opam-publish prepare uucp.0.9.0 http://erratique.ch/software/uucp/releases/uucp-0.9.0.tbz
[uucp-0.9.0.tbz] Downloading http://erratique.ch/software/uucp/releases/uucp-0.9.0.tbz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  334k  100  334k    0     0   955k      0 --:--:-- --:--:-- --:--:--  953k
200
[ERROR] Invalid OPAM file (missing field "name")

How am I supposed to make that work?

Port to opam v2.0 libs

I tried to give it a shot but the APIs seem to have diverged too much for me to this efficiently.

inconsistent with opam lint

Apparently opam publish is more strict than opam lint

/R/conf-brotli ❯❯❯ opam publish prepare https://github.com/fxfactorial/conf-brotli/archive/v0.0.1.tar.gz
[v0.0.1.tar.gz] https://github.com/fxfactorial/conf-brotli/archive/v0.0.1.tar.gz downloaded
[ERROR] Package version unspecified
~/R/conf-brotli ❯❯❯ opam lint opam                                                                                  ⏎
~/Repos/conf-brotli/opam: Passed.

'opam-version' is both prohibited and required?

When trying to submit a new package I get either an error that 'opam-version' is deprecated and that I should use 'available' instead. After removing the offending line in the configuration file and adding "available: [ opam-version = "1.2" ]" I instead get an error from missing 'opam-version'. These two errors seem to be contradictory.
screen shot 2015-01-07 at 2 44 27 pm

cant download github archive

$ OPAMDEBUG=1 ~/src/git/AltGr/opam-publish/opam-publish prepare git.1.4.0 https://github.com/mirage/ocaml-git/archive/v1.4.0.tar.gz
00:00.008  042933  SYSTEM                  mkdir /var/folders/vr/h2mdzb2d2gv29pmvbywrnfjh0000gn/T/opam-42933-5a61c5
00:00.008  042933  CURL                    pull-file into /var/folders/vr/h2mdzb2d2gv29pmvbywrnfjh0000gn/T/opam-42933-5a61c5: https://github.com/mirage/ocaml-git/archive/v1.4.0.tar.gz
[v1.4.0.tar.gz] Downloading https://github.com/mirage/ocaml-git/archive/v1.4.0.tar.gz
00:00.008  042933  SYSTEM                  mkdir /var/folders/vr/h2mdzb2d2gv29pmvbywrnfjh0000gn/T/opam-42933
00:00.009  042933  SYSTEM                  mkdir /var/folders/vr/h2mdzb2d2gv29pmvbywrnfjh0000gn/T/opam-42933/log
[ERROR] https://github.com/mirage/ocaml-git/archive/v1.4.0.tar.gz is not available: https://github.com/mirage/ocaml-git/archive/v1.4.0.tar.gz
00:00.012  042933  SYSTEM                  rmdir /var/folders/vr/h2mdzb2d2gv29pmvbywrnfjh0000gn/T/opam-42933-5a61c5
00:00.015  042933  SYSTEM                  rmdir /var/folders/vr/h2mdzb2d2gv29pmvbywrnfjh0000gn/T/opam-42933

A manual curl on the URL works fine:

$ curl -OL https://github.com/mirage/ocaml-git/archive/v1.4.0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   124    0   124    0     0    232      0 --:--:-- --:--:-- --:--:--   232
  0     0    0  225k    0     0   147k      0 --:--:--  0:00:01 --:--:-- 13.0M

take descr from source archive

Currently, as I understand it, opam-publish will take opam from the newly downloaded source archive, but descr is taken from the repository. I think if descr exists in the source archive, it also should be taken from there.

Please provide alternatives to typing github password in console

Hi,

First, thanks for this tool, I believe that it helps a lot in contributing to opam-repository and is in part responsible for opam's success.

However I would like to raise a concern related to the of the security of the initial login: in order to setup the authorization token, opam-publish prompts for the user's github password on its command line.

While I understand that opam-publish is open source and I can examine it to make sure that this password is only passed to github's API, this is not satisfying. The whole purpose of using a oauth token is that as a user, I should only type my github password in a browser, under a github URL.

Github supports manually creating a token so that it can be inserted into an application. It would be indeed great to have a opam-publish setup --token 0123456789abcdef command, or to have an option so that the initial opam-publish command would prompt for a manually generated access token instead of the master password.

What do you think?

Thanks!

Mandatory long description

[ERROR] In /home/gabriel/source/llvmgraph/llvmgraph.0.2/descr:
  - long description unspecified

Sometimes, packages just don't need a long description. :)
(and this is not enforced by opam lint)

Automate GitHub Release publication

GitHub has a Releases feature. It would be nice to have creation of these releases automated by this tool and potentially filled with a changelog scraped from the archive using a forthcoming changelog library.

Simpler branch scheme

  • The current branch scheme is a bit confusing (ie. using local master and remote opam-publish/<package.version>. It would be simpler to have the same branch name on both repositories (and make it <package.version> no need for the prefix)
  • The current repository name is also not very usual. In my opinion, it would be better to have:
    • the user repository should be named origin
    • the main repository should be named upstream

When all of this is set, it then becomes easier to manually modify ~/.opam/plugins/opam-publish/default, which happens quite often in practice.

`X` ' is outside repository ?

$ opam-publish submit uucp.0.9.0/
[uucp-0.9.0.tbz] Downloading http://erratique.ch/software/uucp/releases/uucp-0.9.0.tbz
Please enter your github name: samoht
Enter host password for user 'samoht':
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15751  100 15751    0     0  18948      0 --:--:-- --:--:-- --:--:-- 18931
# opam-version 1.2.0 (45a71472e438fb0d7a1ae34ef277ddcfac3fb2f9)
# os           darwin
# command      git rm -r /Users/thomas/git/opam-repository/packages/uucp/uucp.0.9.0
# path         /Users/thomas/.opam/plugins/opam-publish/repos/default
# exit-code    128
# env-file     /var/folders/bk/gqw28ztn0qz_yxxlwtfdk0gh0000gn/T/opam-39986/log/log-39986-ad8886.env
# stdout-file  /var/folders/bk/gqw28ztn0qz_yxxlwtfdk0gh0000gn/T/opam-39986/log/log-39986-ad8886.out
# stderr-file  /var/folders/bk/gqw28ztn0qz_yxxlwtfdk0gh0000gn/T/opam-39986/log/log-39986-ad8886.err
### stderr ###
# fatal: /Users/thomas/git/opam-repository/packages/uucp/uucp.0.9.0: '/Users/thomas/git/opam-repository/packages/uucp/uucp.0.9.0' is outside repository

Add a merge command

It might be useful to provide an opam-publish merge command to merge a previsouly submitted pull request. Whilst not very useful when dealing with the main repo because package maintainers are not repository maintainers, it could be useful when maintaining your own opam remote.

Get URL from the repo

For quickly amending an existing package description, it would be nice not to have to specify the remote URL, e.g. provide a shortcut for:

opam publish prepare xxx.v $(opam show --field=upstream-url xxx.v)

[ERROR] Package name unspecified

Hi
I'm trying to prepare a package but I constantly get the [ERROR] Package name unspecified error. E.g.:

$ opam publish prepare electrod.0.1.1 https://github.com/grayswandyr/electrod/archive/0.1.1.tar.gz
[0.1.1.tar.gz] https://github.com/grayswandyr/electrod/archive/0.1.1.tar.gz downloaded
[ERROR] Package name unspecified

It's not very clear... what should I do?
Thanks!

Allow findlib files

I know that the findlib file is still experimental but I think that opam-publish should not fail when it is present.

Tweak the GitHub/commit messages

Apologies if this is a naive request but could the commit message/pull requests be tweaked for opam publish? I'm assuming that what I'm seeing is automated behaviour.

Taking a recent example [1], there are two improvements I'd like to suggest.

  • [opam-publish] cmdliner.0.9.6 -> cmdliner.0.9.6 - via opam-publish

Ultimately, I'd prefer opam-publish not to be mentioned in the first line at all but for now it's useful to see that it's being used. However, mentioning it at the end of the line keeps it out of the way. Especially when it comes to the email subject line that GitHub sends - e.g. Re: [opam-repository] [opam-publish] cmdliner.0.9.6 (#3084)

  • "Pull-request generated by opam-publish v0.2"

I'd prefer this to be moved to the end of the GitHub message so that the actual description is the first thing you read.

These are just quick thoughts and I welcome feedback.

[1] ocaml/opam-repository#3084

Submit transaction

This should be designed with #29 in mind. Sometimes you'd like to submit a set of packages in a single submission otherwise the repo may be in an inconsistant state at some commits.

Something like

opam publish submit --add PKG1
opam publish submit --add PKG2
opam publish submit --commit

Remove name and version from opam files before publication?

opam package files in directory repositories get their name and version from the directory structure rather than the metadata file. opam files in package development repositories use these fields to make pinning easier. There is a gestating policy to have name and version removed in opam files submitted to ocaml/opam-repository. It would be nice to have these fields automatically removed by opam publish.

Segmentation fault

In running opam publish submit ./ocephes.0.8.1/ I've run into a segfault. Running the opam-publish command directly in lldb (I've only tested on osx) I get the following stack trace:

* thread #1: tid = 0x818e5b, 0x000000010017c77c opam-publish`camlGithub_j__read_pull_85589 + 2684, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x31fd)
  * frame #0: 0x000000010017c77c opam-publish`camlGithub_j__read_pull_85589 + 2684
    frame #1: 0x00000001001d072d opam-publish`camlYojson____ocaml_lex_read_list_rev_rec_6511 + 221
    frame #2: 0x00000001001b7eae opam-publish`camlAg_oj_run__read_list_1792 + 62
    frame #3: 0x00000001001ab4a9 opam-publish`camlGithub_core__fun_17973 + 9
    frame #4: 0x00000001001aa604 opam-publish`camlGithub_core__fun_16517 + 212
    frame #5: 0x0000000100295b26 opam-publish`camlLwt__fun_32562 + 86
    frame #6: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #7: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #8: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #9: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #10: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #11: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #12: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #13: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #14: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #15: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #16: 0x00000001002975f7 opam-publish`camlLwt__run_waiters_rec_1372 + 119
    frame #17: 0x00000001002975c9 opam-publish`camlLwt__run_waiters_rec_1372 + 73
    frame #18: 0x00000001002978dc opam-publish`camlLwt__safe_run_waiters_1432 + 44
    frame #19: 0x0000000100294cad opam-publish`camlLwt_sequence__loop_1257 + 45
    frame #20: 0x0000000100294cad opam-publish`camlLwt_sequence__loop_1257 + 45
    frame #21: 0x00000001002a91d1 opam-publish`camlList__iter_1258 + 33
    frame #22: 0x0000000100274f88 opam-publish`camlLwt_engine__fun_2643 + 632
    frame #23: 0x0000000100276998 opam-publish`camlLwt_main__run_1324 + 136
    frame #24: 0x0000000100009dbf opam-publish`camlOpam_publish__pull_request_5565 + 399
    frame #25: 0x000000010000a22b opam-publish`camlOpam_publish__add_metadata_5674 + 555
    frame #26: 0x000000010000b2df opam-publish`camlOpam_publish__submit_8500 + 111
    frame #27: 0x00000001000fbb5d opam-publish`camlCmdliner__fun_36746 + 13
    frame #28: 0x0000000100101d5c opam-publish`camlCmdliner__eval_term_33714 + 780
    frame #29: 0x00000001001022a7 opam-publish`camlCmdliner__eval_choice_34756 + 727
    frame #30: 0x000000010000c569 opam-publish`camlOpam_publish__entry + 4569
    frame #31: 0x0000000100001e29 opam-publish`caml_program + 4057
    frame #32: 0x0000000100322448 opam-publish`caml_start_program + 92
    frame #33: 0x00000001003058e8 opam-publish`caml_main + 488
    frame #34: 0x000000010030593c opam-publish`main + 12

opam switch is 4.03.0. opam publish version is 0.3.1. Let me know if there's any other information I can provide.

`opam-publish submit` interactive behaviour improvements

I think it would be nice to

  1. Provide a command line option to disable [xdg-]open. In that case the PR URI should be output on stdout.
  2. On osx use open -g (man page) in order to open the webpage in the background. It's always a little bit surprising to loose focus of your terminal without you deciding that. Usually there's one or two things I want to do in the terminal after I submitted, having to switch back to the terminal is annoying. Unfortunately it doesn't seem that xdg-open supports that.

Some people may disagree with 2. Here are other alternatives:

a) Have a switch to indicate the use of open rather than one preventing its use. But usually I want the open, just not immediately after the submit.
b) Forget opens on submits and have a another command (review, show ?) that opens the PR of any submitted package that has not been merged yet.

Actually I think b) would be best.

Some feedback about (possibly?) easy improvements

While publishing a package, I encountered some friction with using opam-publish. If we are to encourage using opam-publish as the primary means of publishing to opam, opam-publish maintainers might be interested in this feedback:

1.The release directory doesn't seem to be updated when trying a second time: I fixed my 3.0.3 release hosted on github, and reran the opam-publish prepare && opam-publish submit reason.3.0.3 commands, but since I had a left over reason.3.0.3/ directory with the opam/desc/url file, it didn't update it to see my new changes that I made since trying again. That seems like an easy thing to fix, but I'm curious if anyone else ran into it.
2. opam-publish required that I brew install gmp. That's not ideal, but not sure if there's another way.

Some more feedback:

  1. It feels weird to enter your github password/2FA into a CLI tool that is not baked into opam itself.
  2. Also, it was really difficult to get opam-publish installed on my machine gmp aside. It ended up being my fault because I had another global ocaml compiler installed on my machine (not installed through opam) which was screwing up builds in my switch (partially my fault, partially opam's for not isolating the environment sufficiently).
  3. I had some package conflicts with opam-publish's dependencies that required that I downgrade some packages, and that downgrade itself failed as well. I ended up having to create a brand new switch. This problems stems from the fact that opam-publish is an opam package itself that is installed into the global opam switch (by default - that's what the user will end up doing 99% of the time).

These three points of friction that I experienced has me wondering if a tool likeopam-publish should be baked into opam itself. It would eliminate many of the issues I had with opam-publish. cc @avsm

The opam-publish prepare does not use the opam file in the archive.

When I run opam-publish prepare against an archive, the the generated opam file is not the same as the opam file inside the archive.

As a concrete example:

$ opam-publish prepare https://github.com/mvalle/ocaml-ofx/archive/ofx.0.1.5.zip
$ wget https://github.com/mvalle/ocaml-ofx/archive/ofx.0.1.5.zip
$ unzip ofx.0.1.5.zip
$ diff ofx.0.1.5/opam ocaml-ofx-ofx.0.1.5/opam 
3a4,5
> name: "ofx"
> version: "0.1.5"
8c10,12
< build: [make]

---
> build: [
>   [make]
> ]
15a20
> available: [ocaml-version >= "4.02.0" ]
\ No newline at end of file
$ 

Of the three differences:

  1. Removing the name and version options.
  2. Tidying up the build option.
  3. Removing the available option.

Number 1 and 2 are fine. But number 3 is an annoyance, as you'll have to add the available option back in.

Allow using ssh keys other than the default

It seems that opam-publish does git clone [email protected]:ocaml/opam-repository.git to get the repository. This only works if the key associated with your account is in your default ssh identity. When that is not the case you can't use opam publish.

So it would be useful to give more control on how the repository is created. Either specifically specifying an identity file (I'm not sure how to pass that on through git but I assume there is a way), or just allowing to specify the command which should be used to clone the repo.

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.