hexpm / hex

Package manager for the Erlang ecosystem.
https://hex.pm
972 stars 184 forks source link

github dependencies in hex packages are ignored #242

Closed adrienmo closed 8 years ago

adrienmo commented 8 years ago

I am trying to publish an hex package that has both hex and github dependencies.

If I am adding the hex package to my project:

defp deps, do: [{:hbasex, "~> 0.1.1"}]

the dependency tree (running mix deps.tree) will look like:

testproject
└── hbasex ~> 0.1.1 (Hex package)
    └── poolboy ~> 1.5 (Hex package)

The github dependency of my library is not downloaded. However if I use github to retrieve my library:

defp deps, do: [{:hbasex, github: "adrienmo/hbasex", tag: "0.1.1"}]

the dependency tree (running mix deps.tree) will look like:

testproject
└── hbasex (https://github.com/adrienmo/hbasex.git)
    ├── riffed (https://github.com/pinterest/riffed.git)
    │   ├── thrift (https://github.com/pinterest/elixir-thrift.git)
    │   ├── meck ~> 0.8.2 (Hex package)
    │   ├── mock (https://github.com/jjh42/mock.git)
    │   │   └── meck ~> 0.8.2 (Hex package)
    │   └── exlager (https://github.com/khia/exlager.git)
    │       └── lager (https://github.com/basho/lager.git)
    │           └── goldrush ~r/.*/ (git://github.com/DeadZen/goldrush.git)
    └── poolboy ~> 1.5 (Hex package)

Which is the correct dependency tree I am exepecting to see. I am not sure if I missed something or if this is a bug from hex/mix or if it is just the exepected behavior (package downloaded from hex can only contains hex dependencies).

josevalim commented 8 years ago

That's by design. A package from Hex can only contain Hex dependencies. When you run mix hex.publish, you should see a warning saying those dependencies won't be part of the package.

rupurt commented 3 years ago

@josevalim this restriction also applies to building a local package with mix hex.build. I'd like to be able to test full packages within a monorepo before I publish them to the registry.