Skip to content

Commit

Permalink
Feat/45 use DESCRIPTION (#54)
Browse files Browse the repository at this point in the history
* feat(package): #45 Add DESCRIPTION and LICENSE

* feat(app): #45 Remove imports.R

* build(docker): #45 Use DESCRIPTION in docker build

Closes: #45
  • Loading branch information
AlexAxthelm authored Feb 26, 2024
1 parent 7a7a0bb commit cc3de8a
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 27 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^LICENSE\.md$
46 changes: 46 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Package: workflow.prepare.pacta.indices
Title: Prepare index benchmarks for PACTA analysis
Version: 0.0.0.9000
Authors@R:
c(person(given = "CJ",
family = "Yetman",
role = c("aut", "ctr"),
email = "[email protected]",
comment = c(ORCID = "0000-0001-5099-9500")),
person(given = "Jackson",
family = "Hoffart",
email = "[email protected]",
role = c("aut", "ctr", "cre"),
comment = c(ORCID = "0000-0002-8600-5042")),
person(given = "Alex",
family = "Axthelm",
role = c("aut", "ctr"),
email = "[email protected]",
comment = c(ORCID = "0000-0001-8579-8565")),
person(given = "RMI",
role = c("cph", "fnd"),
email = "[email protected]"))
Description: Create PACTA Results for index benchmarks, to be used as
comparison to user portfolio results.
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.0
Imports:
cli,
dplyr,
fs,
pacta.data.scraping,
pacta.portfolio.allocate,
pacta.portfolio.audit,
pacta.portfolio.import,
pacta.portfolio.utils,
purrr,
readr,
yaml
Remotes:
RMI-PACTA/pacta.data.scraping,
RMI-PACTA/pacta.portfolio.allocate,
RMI-PACTA/pacta.portfolio.audit,
RMI-PACTA/pacta.portfolio.import,
RMI-PACTA/pacta.portfolio.utils
21 changes: 7 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,13 @@ RUN apt-get update \
# install R package dependencies
RUN Rscript -e "install.packages('pak')"

# install PACTA R packages
RUN Rscript -e "pak::pkg_install(pkg = 'RMI-PACTA/pacta.data.scraping')"
RUN Rscript -e "pak::pkg_install(pkg = 'RMI-PACTA/pacta.portfolio.import')"
RUN Rscript -e "pak::pkg_install(pkg = 'RMI-PACTA/pacta.portfolio.allocate')"
RUN Rscript -e "pak::pkg_install(pkg = 'RMI-PACTA/pacta.portfolio.audit')"
RUN Rscript -e "pak::pkg_install(pkg = 'RMI-PACTA/pacta.portfolio.utils')"

# copy imports.R separately from rest of deps to optimize caching
COPY imports.R /workflow.prepare.pacta.indices/imports.R

RUN Rscript -e " \
source('/workflow.prepare.pacta.indices/imports.R'); \
install.packages(requirements) \
"
# Install R deopendencies
COPY DESCRIPTION /workflow.prepare.pacta.indices/DESCRIPTION

# install R package dependencies
RUN Rscript -e "\
deps <- pak::local_install_deps(root = '/workflow.prepare.pacta.indices'); \
"

# copy in workflow repo
COPY . /workflow.prepare.pacta.indices
Expand Down
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2024
COPYRIGHT HOLDER: workflow.prepare.pacta.indices authors
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2024 workflow.prepare.pacta.indices authors

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.
8 changes: 0 additions & 8 deletions imports.R

This file was deleted.

9 changes: 4 additions & 5 deletions prepare_pacta_indices.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# necessary packages -----------------------------------------------------------
# please add all dependencies to imports.R
source("./imports.R")
invisible({
lapply(requirements, function(pkg) {
suppressPackageStartupMessages(library(pkg, character.only = TRUE))
})
suppressPackageStartupMessages({
library("dplyr")
library("purrr")
library("readr")
})

# config
Expand Down

0 comments on commit cc3de8a

Please sign in to comment.