はじめに
- lwwsxというLivedoor Weather Web Service(LWWS)のAPIをラップした(だけの)Hexをなんでもやってみようの精神で公開していました
- 残念なことに、Livedoor Weather Web Service(LWWS)は2020年7月31日(金)14:00にサービス終了となっておりまして、lwwsxの公開を停止しようとおもって調べたことややったことを書いておきます
- まずは公開をしないことには始まらないのですが、そこは公式のPublishing a packageをご参照くださいませ
調べたこと
-
FAQに
Can packages be removed from the repository?の項がありました
Instead of unpublishing we recommend to instead retire a package or release. This should be done if the maintainers no longer recommend its use, because it does not work, has security issues, been deprecated or any other reason. A package is retired with the mix hex.retire task. A retired package will still be resolvable and fetchable but users of the package will get a warning a message and the website will show the release as retired.
-
mix hex.retireを使えばよさそうです - ヘルプをみてみます
$ mix help hex.retire
mix hex.retire
Retires a package version.
mix hex.retire PACKAGE VERSION REASON
mix hex.retire PACKAGE VERSION --unretire
Mark a package as retired when you no longer recommend it's usage. A retired
package is still resolvable and usable but it will be flagged as retired in the
repository and a message will be displayed to users when they use the package.
## Retirement reasons
• renamed - The package has been renamed, including the new package name
in the message
• deprecated - The package has been deprecated, if there's a replacing
package include it in the message
• security - There are security issues with this package
• invalid - The package is invalid, for example it does not compile
correctly
• other - Any other reason not included above, clarify the reason in the
message
## Command line options
• --message "MESSAGE" - Required message (up to 140 characters)
clarifying the retirement reason
• --organization ORGANIZATION - Set this for private packages belonging
to an organization
ふむふむこんな感じかな
$ mix hex.retire lwwsx 0.1.2 invalid --message "Livedoor Weather Web Service(LWWS) is no longer available.
$ mix hex.retire lwwsx 0.1.1 invalid --message "Livedoor Weather Web Service(LWWS) is no longer available.
$ mix hex.retire lwwsx 0.1.0 invalid --message "Livedoor Weather Web Service(LWWS) is no longer available.
retiredしているHexをdeps.getするとどうなる?
$ mix new hello_lwwsx
mix.exs
defp deps do
[
{:lwwsx, "~> 0.1.2"}
]
end
$ cd hello_lwwsx
$ mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
New:
certifi 2.5.2
hackney 1.16.0
httpoison 1.7.0
idna 6.0.1
jason 1.2.2
lwwsx 0.1.2 RETIRED!
(invalid) Livedoor Weather Web Service(LWWS) is no longer available.
metrics 1.0.1
mimerl 1.2.0
parse_trans 3.3.0
ssl_verify_fun 1.1.6
unicode_util_compat 0.5.0
- こんなふうになるのね
RETIRED!
Wrapping Up
-
mix deps.getしたときになにかメッセージがでていないかはみておいたほうがよさそうですね -
Enjoy !!!



