Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package overhaul #61

Merged
merged 82 commits into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
c0fe7bb
The Big Squash: A bunch of irrelevant garbage
christopher-dG Feb 5, 2019
ea386ec
Delete REQUIRE
christopher-dG Aug 26, 2019
9dedf91
Travis tweaks
christopher-dG Aug 26, 2019
cfed5fc
Use Parameters.with_kw instead of kwdef for 1.0 compat
christopher-dG Aug 26, 2019
05255f5
Update the Project.toml with TOML instead of string manipulation
christopher-dG Aug 27, 2019
47ccb10
More Travis changes
christopher-dG Aug 27, 2019
0d3b124
Make authors a vector, misc tweaks
christopher-dG Aug 27, 2019
4d8b5d3
Some rendering stuff
christopher-dG Aug 27, 2019
4fa7d9a
Track the PkgTemplates version in commit messages
christopher-dG Aug 27, 2019
810ac5a
Many misc changes and bug fixes
christopher-dG Aug 29, 2019
5adde3a
Add some basic tests
christopher-dG Aug 31, 2019
e7a51c9
Delete old docs, update build
christopher-dG Aug 31, 2019
c8bc144
Fix some doc stuff
christopher-dG Aug 31, 2019
439ad33
More reference tests, fix a bug or two
christopher-dG Aug 31, 2019
1d26885
Semicolons
christopher-dG Aug 31, 2019
99bc709
Fixes for GitLabCI and Documenter
christopher-dG Aug 31, 2019
e4f9743
Fix a Winows test bug, delete some CI jobs
christopher-dG Aug 31, 2019
b70d3c9
A few more tests
christopher-dG Sep 1, 2019
d5a341c
Delete the outdated interactive code for now
christopher-dG Sep 1, 2019
9b68d22
Add coverage back
christopher-dG Sep 1, 2019
f61253b
Trim the readme, hopefully fix another Windows test bug
christopher-dG Sep 1, 2019
493c54a
More tests, more Windows fiddling
christopher-dG Sep 1, 2019
65f5eff
Lots of documentation
christopher-dG Sep 1, 2019
481d843
Add show methods
christopher-dG Sep 2, 2019
2d7c851
Only use custom show methods for plaintext display
christopher-dG Sep 3, 2019
7a2a43f
Lots of documentation changes
christopher-dG Sep 18, 2019
f6272e1
Add option to create test/Project.toml (#95)
christopher-dG Sep 18, 2019
358c213
Escape HTML the right way
christopher-dG Sep 18, 2019
4e1247c
Fix a Windows test, maybe
christopher-dG Sep 19, 2019
3b9714c
Move around the template files, update the licenses
christopher-dG Sep 19, 2019
12fcc12
Remove .txt suffix from reference test files
christopher-dG Sep 19, 2019
146c1bd
Add prehooks/posthooks for more fine-grained plugin control
christopher-dG Sep 19, 2019
2a5fb5c
Move the default plugins into their own files, fix some bugs
christopher-dG Sep 19, 2019
980452f
Tweak docs
christopher-dG Sep 19, 2019
0cf6d47
Add execution priority to plugins
christopher-dG Sep 20, 2019
89e0ed5
Fixes for 1.0
christopher-dG Sep 20, 2019
6a49bd7
Fix some tests on 1.3+
christopher-dG Sep 20, 2019
63f1f76
Fix some oversights
christopher-dG Sep 24, 2019
5e843da
Replace Cassette mocking with SimpleMock
christopher-dG Sep 24, 2019
6d95bf7
Enable priority per-hook
christopher-dG Sep 24, 2019
d53fb0b
More docs!
christopher-dG Sep 24, 2019
a941b96
Fix some docs and comments
christopher-dG Sep 24, 2019
5776537
Minor bug/doc fixes
christopher-dG Sep 24, 2019
e05e5be
Add a basic migration guide
christopher-dG Sep 24, 2019
cd40cb4
Allow empty username when it's not used
christopher-dG Sep 25, 2019
2b0e4bc
Rename julia_version -> julia
christopher-dG Sep 25, 2019
385195c
Improve documentation clarity
christopher-dG Sep 25, 2019
fd995a0
Add per-plugin validation at template construction time
christopher-dG Sep 25, 2019
49a1dae
Tweak some docs
christopher-dG Sep 25, 2019
004d84e
Fix rebase mistakes
christopher-dG Sep 25, 2019
05b8d22
Add interactive Template constructor, but not interactive Plugins
christopher-dG Sep 26, 2019
3aa4316
Remove .DS_Store from gitignore
christopher-dG Sep 26, 2019
5aa0a87
Remove /docs/site from Documenter's gitignore
christopher-dG Sep 26, 2019
0fcbaa8
Add compat with Julia 1.4
christopher-dG Sep 26, 2019
17e3927
Use active_project instead of current_project for expected behaviour
christopher-dG Sep 26, 2019
3f88652
Start implementing the interactive plugin constructors
christopher-dG Sep 26, 2019
3a9c963
A bunch of experimental interactive code
christopher-dG Sep 26, 2019
a373a25
Add interactive constructor for Documenter
christopher-dG Sep 26, 2019
719538e
Move some code around
christopher-dG Sep 27, 2019
f7743df
Add more template saving recommendations
christopher-dG Sep 27, 2019
f630f9c
Properly allow not prompting for fields with defaults
christopher-dG Sep 27, 2019
19afffb
Add a compat entry for Mustache
christopher-dG Sep 27, 2019
aa3e776
Add another set of reference tests, fix a bug they found
christopher-dG Sep 28, 2019
441eee3
Update docs with interactive stuff
christopher-dG Sep 28, 2019
de22378
Make the license tests pass next year, too
christopher-dG Oct 4, 2019
cce0f5a
Merge branch 'master' into cdg/plugins
christopher-dG Oct 5, 2019
5e9ff16
Remove interactive stuff (for now)
christopher-dG Oct 6, 2019
ad8e78d
Add DroneCI plugin for new PkgTemplates
christopher-dG Oct 6, 2019
266a22d
Check and warn for unused keywords, update some metadata
christopher-dG Oct 6, 2019
ca51806
Reduce line length of docstrings
christopher-dG Oct 6, 2019
69a7c5c
Add a test for the test/Project.toml warning
christopher-dG Oct 6, 2019
eac2a12
Update deps/fixtures, skip more tests when Git is not installed
christopher-dG Oct 16, 2019
1d2810e
Add some custom template examples
christopher-dG Oct 22, 2019
b3449ee
Add a fetch ref to the remote, too
christopher-dG Oct 22, 2019
ab55313
Add a bit more detail to the extra kwargs warning
christopher-dG Nov 1, 2019
206b7e9
Support ARM builds on Travis CI
christopher-dG Nov 1, 2019
5a89343
Disable pretty urls except in CI
christopher-dG Nov 1, 2019
aaa1f52
Clean up Travis configs and temp name generation
christopher-dG Nov 1, 2019
6bb3c2c
Add version option to ProjectFile plugin to set initial version
christopher-dG Nov 4, 2019
4d70635
Add GitHubActions plugin for CI and docs
christopher-dG Nov 8, 2019
8edafa6
Fix a gitignore bug
christopher-dG Nov 8, 2019
90253e5
Add some more Documenter reference tests
christopher-dG Nov 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .codecov.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* eol=lf
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.DS_Store
*.jl.cov
/docs/build/
*.jl.*.cov
*.jl.cov
*.jl.mem
/docs/build/
/docs/site/
43 changes: 31 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
language: julia
notifications:
email: false
os:
- linux
- osx
- windows
julia:
- 1.0
- 1.1
- 1.2
- 1.3
- nightly
before_script:
- git config --global user.name Tester
- git config --global user.email te@st.er
matrix:
fast_finish: true
allow_failures:
- julia: 1.3
- julia: nightly
fast_finish: true
notifications:
email: false
after_success: julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
jobs:
include:
- os: linux
arch: x86
julia: 1.0
- os: windows
arch: x86
julia: 1.0
- stage: Documentation
julia: 1.1
script: julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(path=pwd()));
Pkg.instantiate();
include("docs/make.jl");'
julia: 1.0
script:
- git config --global user.name name
- git config --global user.email email
- git config --global github.user username
- julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Pkg.instantiate();
include("docs/make.jl");'
after_success: skip
after_success: julia -e '
using Pkg;
Pkg.add("Coverage");
using Coverage;
Codecov.submit(process_folder());'
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
MIT License

Copyright (c) 2017-2019 Chris de Graaf, Invenia Technical Computing Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
44 changes: 27 additions & 17 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[DataAPI]]
git-tree-sha1 = "674b67f344687a88310213ddfa8a2b3c76cc4252"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.1.0"

[[DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down Expand Up @@ -39,9 +49,21 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[Mustache]]
deps = ["Printf", "Tables"]
git-tree-sha1 = "d27b8b8b99c052ea1fdd40c678bfb2dfaec4e96e"
git-tree-sha1 = "f39de3a12232eb47bd0629b3a661054287780276"
uuid = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
version = "0.5.12"
version = "0.5.13"

[[OrderedCollections]]
deps = ["Random", "Serialization", "Test"]
git-tree-sha1 = "c4c13474d23c60d20a67b217f1d7f22a40edf8f1"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.1.0"

[[Parameters]]
deps = ["OrderedCollections"]
git-tree-sha1 = "b62b2558efb1eef1fa44e4be5ff58a515c287e38"
uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a"
version = "0.12.0"

[[Pkg]]
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
Expand All @@ -59,12 +81,6 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[Requires]]
deps = ["Test"]
git-tree-sha1 = "f6fbf4ba64d295e146e49e021207993b6b48c7d1"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "0.5.2"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

Expand All @@ -81,21 +97,15 @@ uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
version = "1.0.0"

[[Tables]]
deps = ["IteratorInterfaceExtensions", "LinearAlgebra", "Requires", "TableTraits", "Test"]
git-tree-sha1 = "351a4b894122e1553c6ed05fda54086ab036adef"
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"]
git-tree-sha1 = "aaed7b3b00248ff6a794375ad6adf30f30ca5591"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "0.2.5"
version = "0.2.11"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[URIParser]]
deps = ["Test", "Unicode"]
git-tree-sha1 = "6ddf8244220dfda2f17539fa8c9de20d6c575b69"
uuid = "30578b45-9adc-5946-b283-645ec420af67"
version = "0.4.0"

[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Expand Down
16 changes: 10 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
name = "PkgTemplates"
uuid = "14b8a8f1-9102-5b29-a752-f990bacb7fe1"
authors = ["Chris de Graaf <chrisadegraaf@gmail.com>"]
version = "0.6.3"
authors = ["Chris de Graaf", "Invenia Technical Computing Corporation"]
version = "0.7.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
Mustache = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
URIParser = "30578b45-9adc-5946-b283-645ec420af67"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
Mustache = ">= 0.5.13"
julia = "1"

[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReferenceTests = "324d217c-45ce-50fc-942e-d289b448e8cf"
SimpleMock = "a896ed2c-15a5-4479-b61d-a0e88e2a1d25"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Suppressor", "Random", "ReferenceTests", "SimpleMock", "Test"]
157 changes: 33 additions & 124 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,147 +1,56 @@
# PkgTemplates

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://invenia.github.io/PkgTemplates.jl/stable)
[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/PkgTemplates.jl/latest)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://invenia.github.io/PkgTemplates.jl/dev)
[![Build Status](https://travis-ci.org/invenia/PkgTemplates.jl.svg?branch=master)](https://travis-ci.org/invenia/PkgTemplates.jl)
[![Build Status](https://ci.appveyor.com/api/projects/status/r24xamruqlm88uti/branch/master?svg=true)](https://ci.appveyor.com/project/christopher-dG/pkgtemplates-jl/branch/master)
[![Codecov](https://codecov.io/gh/invenia/PkgTemplates.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/invenia/PkgTemplates.jl)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)

**PkgTemplates is a Julia package for creating new Julia packages in an easy,
repeatable, and customizable way.**
**PkgTemplates creates new Julia packages in an easy, repeatable, and customizable way.**

## Installation

```julia
pkg> add PkgTemplates
christopher-dG marked this conversation as resolved.
Show resolved Hide resolved
```

## Plugins
Install with Pkg, just like any other registered Julia package:

`PkgTemplates` is based on plugins which handle the setup of individual package components.
The available plugins are:

* Continuous Integration (CI)
* [Travis CI](https://travis-ci.com) (Linux, MacOS)
* [AppVeyor](https://appveyor.com) (Windows)
* [GitLabCI](https://gitlab.com) (Linux)
* [CirrusCI](https://cirrus-ci.org) (FreeBSD)
* Code Coverage
* [Codecov](https://codecov.io)
* [Coveralls](https://coveralls.io)
* Documentation
* [GitHubPages](https://pages.github.com)
* Citation
```jl
pkg> add PkgTemplates # Press ']' to enter te Pkg REPL mode.
```

## Usage

Assuming you have the relatively standard Git options `user.name`, `user.email` and `github.user` set up globally with `git config --global`, the simplest template requires no arguments:

```julia
julia> using PkgTemplates

julia> t = Template()
Template:
User: christopher-dG
Host: github.com
License: MIT (Chris de Graaf 2018)
Package directory: ~/.julia/dev
Minimum Julia version: v1.0
SSH remote: No
Commit Manifest.toml: No
Plugins: None

julia> generate("MyPkg", t)

julia> run(`git -C $(joinpath(t.dir, "MyPkg")) ls-files`);
.gitignore
LICENSE
Manifest.toml
Project.toml
README.md
REQUIRE
src/MyPkg.jl
test/runtests.jl
```
Creating a `Template` is as simple as:

However, we can also configure a number of keyword arguments to `Template`:

```julia
julia> t = Template(;
user="myusername",
license="ISC",
authors=["Chris de Graaf", "Invenia Technical Computing Corporation"],
dir="~/code",
julia_version=v"0.7",
plugins=[
TravisCI(),
Codecov(),
Coveralls(),
AppVeyor(),
GitHubPages(),
CirrusCI(),
],
)
Template:
User: myusername
Host: github.com
License: ISC (Chris de Graaf, Invenia Technical Computing Corporation 2018)
Package directory: ~/code
Minimum Julia version: v0.7
SSH remote: No
Commit Manifest.toml: No
Plugins:
• AppVeyor:
Config file: Default
0 gitignore entries
• Codecov:
Config file: None
3 gitignore entries: "*.jl.cov", "*.jl.*.cov", "*.jl.mem"
• Coveralls:
Config file: None
3 gitignore entries: "*.jl.cov", "*.jl.*.cov", "*.jl.mem"
• GitHubPages:
0 asset files
2 gitignore entries: "/docs/build/", "/docs/site/"
• TravisCI:
Config file: Default
0 gitignore entries

julia> generate(t, "MyPkg2")

julia> run(`git -C $(joinpath(t.dir, "MyPkg2")) ls-files`);
.appveyor.yml
.gitignore
.travis.yml
LICENSE
Project.toml
README.md
REQUIRE
docs/Manifest.toml
docs/Project.toml
docs/make.jl
docs/src/index.md
src/MyPkg2.jl
test/runtests.jl
```jl
using PkgTemplates
t = Template()
```

Information on each keyword as well as plugin types can be found in the
[documentation](https://invenia.github.io/PkgTemplates.jl/stable).
The no-keywords constructor assumes the existence of some preexisting Git configuration (set with `git config --global`):

If that looks like a lot of work, you can also create templates interactively
with `interactive_template`:
- `user.name`: Your real name, e.g. John Smith.
- `user.email`: Your email address, eg. john.smith@acme.corp.
- `github.user`: Your GitHub username: e.g. john-smith.

[![asciicast](https://asciinema.org/a/31bZqW9u8h5RHpd7gtsemioRV.png)](https://asciinema.org/a/31bZqW9u8h5RHpd7gtsemioRV)
Once you have a `Template`, use it to generate a package:

And if that's **still** too much work for you, you can call
`interactive_template` with `fast=true` to use default values for everything
but username and plugin selection.
```jl
t("MyPkg")
```

You can also use `generate_interactive` to interactively generate a template and then
immediately use it to create a new package.
However, it's probably desirable to customize the template to your liking with various options and plugins:

```jl
t = Template(;
dir="~/code",
plugins=[
Git(; manifest=true, ssh=true),
Codecov(),
TravisCI(; x86=true),
Documenter{TravisCI}(),
],
)
```

## Contributing
---

It's extremely easy to extend `PkgTemplates` with new plugins. To get started,
check out the
[plugin development guide](https://invenia.github.io/PkgTemplates.jl/stable/pages/plugin_development.html).
For a much more detailled overview, please see the documentation.
3 changes: 0 additions & 3 deletions REQUIRE

This file was deleted.

Loading