Skip to content

Commit 65bac16

Browse files
committed
Initial commit
Structure taken from DataAPI.jl.
0 parents  commit 65bac16

File tree

8 files changed

+149
-0
lines changed

8 files changed

+149
-0
lines changed

.github/workflows/TagBot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
jobs:
8+
TagBot:
9+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: JuliaRegistries/TagBot@v1
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
tags: '*'
10+
jobs:
11+
test:
12+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
version:
18+
- '1.0'
19+
- '1' # automatically expands to the latest stable 1.x release of Julia
20+
- 'nightly'
21+
os:
22+
- ubuntu-latest
23+
arch:
24+
- x64
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: julia-actions/setup-julia@v1
28+
with:
29+
version: ${{ matrix.version }}
30+
arch: ${{ matrix.arch }}
31+
- uses: actions/cache@v1
32+
env:
33+
cache-name: cache-artifacts
34+
with:
35+
path: ~/.julia/artifacts
36+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
37+
restore-keys: |
38+
${{ runner.os }}-test-${{ env.cache-name }}-
39+
${{ runner.os }}-test-
40+
${{ runner.os }}-
41+
- uses: julia-actions/julia-buildpkg@v1
42+
- uses: julia-actions/julia-runtest@v1
43+
- uses: julia-actions/julia-processcoverage@v1
44+
- uses: codecov/codecov-action@v1
45+
with:
46+
file: lcov.info
47+
# docs:
48+
# name: Documentation
49+
# runs-on: ubuntu-latest
50+
# steps:
51+
# - uses: actions/checkout@v2
52+
# - uses: julia-actions/setup-julia@v1
53+
# with:
54+
# version: '1'
55+
# - run: |
56+
# julia --project=docs -e '
57+
# using Pkg
58+
# Pkg.develop(PackageSpec(path=pwd()))
59+
# Pkg.instantiate()'
60+
# - run: julia --project=docs docs/make.jl
61+
# env:
62+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
# DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
docs/build/
3+
docs/site/
4+
*.jl.cov
5+
*.jl.*.cov
6+
*.jl.mem

LICENSE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The StatsAPI.jl package is licensed under the MIT "Expat" License:
2+
3+
> Copyright (c) 2021: JuliaStats Contributors.
4+
>
5+
> Permission is hereby granted, free of charge, to any person obtaining
6+
> a copy of this software and associated documentation files (the
7+
> "Software"), to deal in the Software without restriction, including
8+
> without limitation the rights to use, copy, modify, merge, publish,
9+
> distribute, sublicense, and/or sell copies of the Software, and to
10+
> permit persons to whom the Software is furnished to do so, subject to
11+
> the following conditions:
12+
>
13+
> The above copyright notice and this permission notice shall be
14+
> included in all copies or substantial portions of the Software.
15+
>
16+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20+
> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22+
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name = "StatsAPI"
2+
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
3+
authors = ["Milan Bouchet-Valat <[email protected]"]
4+
version = "1.0.0"
5+
6+
[compat]
7+
julia = "1"
8+
9+
[extras]
10+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
11+
12+
[targets]
13+
test = ["Test"]

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# StatsAPI.jl
2+
3+
[![CI](https://github.com/JuliaStats/StatsAPI.jl/workflows/CI/badge.svg)](https://github.com/JuliaStats/StatsAPI.jl/actions?query=workflow%3ACI)
4+
[![deps](https://juliahub.com/docs/StatsAPI/deps.svg)](https://juliahub.com/ui/Packages/StatsAPI/3a8mN?t=2)
5+
[![version](https://juliahub.com/docs/StatsAPI/version.svg)](https://juliahub.com/ui/Packages/StatsAPI/3a8mN)
6+
[![pkgeval](https://juliahub.com/docs/StatsAPI/pkgeval.svg)](https://juliahub.com/ui/Packages/StatsAPI/3a8mN)
7+
8+
### Purpose
9+
This package provides a namespace for data-related generic function definitions to solve the optional dependency problem; packages wishing to share and/or extend functions can avoid depending directly on each other by moving the function definition to StatsAPI.jl and each package taking a dependency on it. As such, it is paramount for StatsAPI.jl to be as minimal as possible, defining only generic function stubs and very little else. PRs proposing external dependencies or involved definitions will not be accepted.
10+
11+
### Adding New Functions
12+
When a function is proposed to be defined in StatsAPI.jl, it must include clear documentation of its purpose, convention, and API, as well as specify which package will "own" any generic fallback definitions. Functions will not be exported from StatsAPI.jl, but are left to extending packages to choose whether it is exported from their package or not.
13+
14+
### Extending StatsAPI.jl Functions
15+
Packages wishing to extend a function defined in StatsAPI.jl should first take a dependency on StatsAPI.jl, then define their own method, taking care to properly follow the correct API, and including their package's type in the signature. They *should not* attempt to "pirate" methods with types not owned by the package, or provide their own generic fallbacks, this includes defining methods for `Base` types. If additional methods are desired, discussion should be had with the maintainers of the "owning" package of the generic function. It is recommended to specify version compatibility like `StatsAPI = "1"` in your package, so additional patch release updates to StatsAPI.jl are supported. In the very unlikely event that StatsAPI.jl releases a breaking release 2.0, your package will need to update any broken code and tag a new release with version compatibility like `StatsAPI = "2"`.
16+
17+
### StatsAPI.jl Function Users
18+
*Users* of functions defined in StatsAPI.jl should be aware that taking a dependency on StatsAPI.jl itself is not encouraged, since it exists to coordinate inter-package function sharing, and not to provide any functionality. To actually *use* functions defined in StatsAPI.jl, please review which package "owns" the function, and take a dependency on it, to ensure the default definitions are available, with additional methods being available as non-owning packages are loaded which extend the function defined in StatsAPI.jl.
19+
20+
### StatsAPI.jl Functions
21+
As this package is developer-focused, please see the [source code](https://github.com/JuliaStats/StatsAPI.jl/blob/master/src/StatsAPI.jl) directly for additional information on current functions defined and their documentation.

src/StatsAPI.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module StatsAPI
2+
3+
end # module

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using Test, StatsAPI
2+
3+
@testset "StatsAPI" begin
4+
5+
# Nothing to test currently apart from checking that package can be loaded
6+
7+
end # @testset "StatsAPI"

0 commit comments

Comments
 (0)