Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
genotrance committed Oct 17, 2018
2 parents cf7263d + 66d79bf commit 3d7227c
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 25 deletions.
37 changes: 37 additions & 0 deletions changelog.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,43 @@

# Nimble changelog

## 0.9.0 - 19/09/2018

This is a major new release which contains at least one breaking change.
Unfortunately even though it was planned, support for lock files did not
make it into this release. The release does
however contain a large number of fixes spread across 57 commits.

The breaking change in this release is to do with the handling of binary
package. **Any package that specifies a ``bin`` value in it's .nimble file**
**will no longer install any Nim source code files**, in other words it's not
going to be a hybrid package by default. This means that so called "hybrid
packages" now need to specify ``installExt = @["nim"]`` in their metadata,
otherwise they will become binary packages only.

- **Breaking:** hybrid packages require ``installExt = @["nim"]``
([Commit](https://github.com/nim-lang/nimble/commit/09091792615eacd503e87ca70252c572a4bde2b5))
- **The ``init`` command can now show a list of choices for information such as**
**the license.**
- **The ``init`` command now creates correct project structures for all package**
**types.**
- **Fatal errors are no longer created when the path inside a .nimble-link file**
**doesn't exist.**
- **The ``develop`` command now always clones HEAD and grabs the full repo history.**
- **The default ``test`` task no longer executes all tests (only those starting with 't').**
- Colour is no longer used when `isatty` is false.
- ``publish`` now shows the URL of the created PR.
- The ``getPkgDir`` procedure has been fixed in the Nimble file API.
- Improved handling of proxy environment variables.
- Codebase has been improved not to rely on `nil` in strings and seqs.
- The handling of pre- and post-hooks has been improved significantly.
- Fixed the ``path`` command for packages with a ``srcDir`` and optimised the
package look-up.

----

Full changelog: https://github.com/nim-lang/nimble/compare/v0.8.10...v0.9.0

## 0.8.10 - 23/02/2018

The first release of 2018! Another fairly big release containing 40 commits.
Expand Down
5 changes: 2 additions & 3 deletions src/nimble.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import system except TResult

import httpclient, parseopt, os, osproc, pegs, tables, parseutils,
strtabs, json, algorithm, sets, uri, future, sequtils
strtabs, json, algorithm, sets, uri, sugar, sequtils

import strutils except toLower
from unicode import toLower
Expand Down Expand Up @@ -942,8 +942,7 @@ proc developFromDir(dir: string, options: Options) =
writeNimbleLink(nimbleLinkPath, nimbleLink)

# Save a nimblemeta.json file.
saveNimbleMeta(pkgDestDir, "file://" & dir, vcsRevisionInDir(dir),
nimbleLinkPath)
saveNimbleMeta(pkgDestDir, dir, vcsRevisionInDir(dir), nimbleLinkPath)

# Save the nimble data (which might now contain reverse deps added in
# processDeps).
Expand Down
2 changes: 1 addition & 1 deletion src/nimblepkg/common.nim
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ when not defined(nimscript):
return (error, hint)

const
nimbleVersion* = "0.8.11"
nimbleVersion* = "0.9.0"
10 changes: 5 additions & 5 deletions src/nimblepkg/nimscriptsupport.nim
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ proc isStrLit(n: PNode): bool = n.kind in {nkStrLit..nkTripleStrLit}

when declared(NimCompilerApiVersion):
const finalApi = NimCompilerApiVersion >= 2

when NimCompilerApiVersion >= 3:
import compiler / pathutils
else:
const finalApi = false

when NimCompilerApiVersion >= 3:
import compiler / pathutils

proc getGlobal(g: ModuleGraph; ident: PSym): string =
when finalApi:
let n = vm.getGlobalValue(PCtx g.vm, ident)
Expand Down Expand Up @@ -154,7 +154,7 @@ proc setupVM(graph: ModuleGraph; module: PSym; scriptName: string, flags: Flags)
cbos copyFile:
os.copyFile(getString(a, 0), getString(a, 1))
cbos getLastModificationTime:
setResult(a, toSeconds(getLastModificationTime(getString(a, 0))))
setResult(a, toUnix(getLastModificationTime(getString(a, 0))))

cbos rawExec:
setResult(a, osproc.execCmd getString(a, 0))
Expand Down Expand Up @@ -713,4 +713,4 @@ proc listTasks*(scriptName: string, options: Options) =
discard execScript(scriptName, nil, options)
# TODO (#402): Make the 'task' template generate explicit data structure
# containing all the task names + descriptions.
cleanup()
cleanup()
12 changes: 0 additions & 12 deletions src/nimblepkg/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,6 @@ proc promptList*(options: Options, question: string, args: openarray[string]): s
## options is selected.
return promptList(options.forcePrompts, question, args)

proc renameBabelToNimble(options: Options) {.deprecated.} =
let babelDir = getHomeDir() / ".babel"
let nimbleDir = getHomeDir() / ".nimble"
if dirExists(babelDir):
if options.prompt("Found deprecated babel package directory, would you " &
"like to rename it to nimble?"):
copyDir(babelDir, nimbleDir)
copyFile(babelDir / "babeldata.json", nimbleDir / "nimbledata.json")

removeDir(babelDir)
removeFile(nimbleDir / "babeldata.json")

proc getNimbleDir*(options: Options): string =
result = options.config.nimbleDir
if options.nimbleDir.len != 0:
Expand Down
2 changes: 1 addition & 1 deletion src/nimblepkg/packageparser.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) Dominik Picheta. All rights reserved.
# BSD License. Look at license.txt for more info.
import parsecfg, json, streams, strutils, parseutils, os, tables, future
import parsecfg, json, streams, strutils, parseutils, os, tables, sugar
from sequtils import apply, map

import version, tools, common, nimscriptsupport, options, packageinfo, cli
Expand Down
4 changes: 2 additions & 2 deletions src/nimblepkg/publish.nim
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ proc getGithubAuth(o: Options): Auth =
proc isCorrectFork(j: JsonNode): bool =
# Check whether this is a fork of the nimble packages repo.
result = false
if j{"fork"}.getBVal():
if j{"fork"}.getBool():
result = j{"parent"}{"full_name"}.getStr() == "nim-lang/packages"

proc forkExists(a: Auth): bool =
Expand Down Expand Up @@ -217,7 +217,7 @@ proc publish*(p: PackageInfo, o: Options) =

cd pkgsDir:
editJson(p, url, tags, downloadMethod)
let branchName = "add-" & p.name & getTime().getGMTime().format("HHmm")
let branchName = "add-" & p.name & getTime().utc.format("HHmm")
doCmd("git checkout -B " & branchName)
doCmd("git commit packages.json -m \"Added package " & p.name & "\"")
display("Pushing", "to remote of fork.", priority = HighPriority)
Expand Down
2 changes: 1 addition & 1 deletion tests/tester.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) Dominik Picheta. All rights reserved.
# BSD License. Look at license.txt for more info.
import osproc, streams, unittest, strutils, os, sequtils, future
import osproc, streams, unittest, strutils, os, sequtils, sugar

# TODO: Each test should start off with a clean slate. Currently installed
# packages are shared between each test which causes a multitude of issues
Expand Down

0 comments on commit 3d7227c

Please sign in to comment.