Skip to content

Commit

Permalink
make into a package
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Sep 21, 2020
1 parent 1d696a3 commit 8ef0e58
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Manifest.toml
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Documentation: http://docs.travis-ci.com/user/languages/julia
language: julia
notifications:
email: false
julia:
- 1.3
- 1
- nightly
os:
- linux
- osx
- windows
arch:
- x64
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Kristoffer <[email protected]> and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
12 changes: 12 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name = "Grisu"
uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe"
version = "1.0.0"

[compat]
julia = "1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Grisu

[![Build Status](https://travis-ci.com/JuliaAttic/Grisu.jl.svg?branch=master)](https://travis-ci.com/JuliaAttic/Grisu.jl)

The (internal) Grisu module was removed in Julia 1.6. However, some packages
relies on this module. To keep this working, the Grisu module was filtered out
as a normal package that can be depended on.

Use it as follows, add a dependency on Grisu and use this instead of normally
loading it:

```julia
if isdefined(Base, :Grisu)
const Grisu = Base.Grisu
else
import Grisu
end
```

12 changes: 6 additions & 6 deletions src/grisu.jl → src/Grisu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const SHORTEST = 1
const FIXED = 2
const PRECISION = 3

include("grisu/float.jl")
include("grisu/fastshortest.jl")
include("grisu/fastprecision.jl")
include("grisu/fastfixed.jl")
include("grisu/bignums.jl")
include("grisu/bignum.jl")
include("float.jl")
include("fastshortest.jl")
include("fastprecision.jl")
include("fastfixed.jl")
include("bignums.jl")
include("bignum.jl")

const DIGITS = Vector{UInt8}(undef, 309+17)
const BIGNUMS = [Bignums.Bignum(),Bignums.Bignum(),Bignums.Bignum(),Bignums.Bignum()]
Expand Down
5 changes: 2 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Base.Grisu
using Test
using Grisu

function trimrep(buffer)
len = length(unsafe_string(pointer(buffer)))
Expand Down

2 comments on commit 8ef0e58

@KristofferC
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/21688

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.0 -m "<description of version>" 8ef0e58072ff893eefbee593d0cc618a3227e3ef
git push origin v1.0.0

Please sign in to comment.