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

v.0.2.2.2 #33

Merged
merged 44 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
deea15b
Set default `styler` style
GegznaV Apr 29, 2023
8442b10
Update DESCRIPTION
GegznaV Apr 29, 2023
cb3d6a6
Update pkgs-required-version.txt
GegznaV Apr 29, 2023
6deff81
Update GHA workflows
GegznaV Apr 29, 2023
502dcfe
Update pkgdown.yaml
GegznaV Apr 29, 2023
850470e
Update .Rprofile
GegznaV Apr 29, 2023
69873b7
Backup previous version of settings
GegznaV Aug 8, 2023
668b1e3
Update settings (rstudio-default)
GegznaV Aug 8, 2023
42fd317
Fix settings
GegznaV Aug 8, 2023
065455f
Update programs-required-version.txt
GegznaV Aug 8, 2023
0539107
Backup previous version of settings
GegznaV Aug 8, 2023
7ea18b6
Clarify instructions
GegznaV Aug 8, 2023
51cbe7f
Create function `pkg_list_archived_versions()`
GegznaV Aug 8, 2023
d49e7ee
Fix spelling
GegznaV Aug 8, 2023
0994fd4
Update NAMESPACE
GegznaV Aug 8, 2023
5b94070
Create pkg_list_archived_versions.Rd
GegznaV Aug 8, 2023
421d7a4
Do not export `rstudio_install_spellcheck_dictionary_lt()`
GegznaV Aug 8, 2023
b061e13
Delete lt_LT dictionary
GegznaV Aug 8, 2023
c65603b
Update pkgs-required-version.txt
GegznaV Aug 8, 2023
03c9182
Update DESCRIPTION
GegznaV Aug 8, 2023
ec4ea9b
Update pkgdown.yaml
GegznaV Aug 8, 2023
aea5d62
Update R-CMD-check.yaml
GegznaV Aug 8, 2023
8202fa5
Update drat--publish-package.yaml
GegznaV Aug 8, 2023
01290a3
Update pkgdown.yaml
GegznaV Aug 8, 2023
4187923
Update drat--publish-package.yaml
GegznaV Aug 8, 2023
f4dfb30
Update DESCRIPTION
GegznaV Aug 8, 2023
4d9b311
Update README.md
GegznaV Aug 8, 2023
ec269e8
Update README.Rmd
GegznaV Aug 8, 2023
62bb3df
Update README.md
GegznaV Aug 8, 2023
0d8cf6f
Remove unused functions
GegznaV Aug 8, 2023
8e373fa
Update documentation after file removal
GegznaV Aug 8, 2023
c459907
Update README.Rmd
GegznaV Aug 8, 2023
a5d31dd
Update R-CMD-check.yaml
GegznaV Aug 8, 2023
d93468f
Update pkgdown.yaml
GegznaV Aug 8, 2023
e301484
Update drat--publish-package.yaml
GegznaV Aug 8, 2023
0ca0450
Update DESCRIPTION
GegznaV Aug 8, 2023
1336dbe
Update R-CMD-check.yaml
GegznaV Aug 8, 2023
4d6184a
Update R-CMD-check.yaml
GegznaV Aug 8, 2023
288741b
Update R-CMD-check.yaml
GegznaV Aug 8, 2023
ce1ef92
Fix examples
GegznaV Aug 8, 2023
5d0d4de
Import function
GegznaV Aug 8, 2023
12010c9
Remove unused package
GegznaV Aug 8, 2023
64dd8df
Disable code
GegznaV Aug 8, 2023
fec24ec
Delete .Rprofile
GegznaV Aug 8, 2023
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
22 changes: 16 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,36 @@ on:
branches: [main, master, devel]
pull_request:
branches: [main, master, devel]
schedule:
# (see https://crontab.guru)
- cron: "30 3 * */2 TUE"
workflow_dispatch:

name: R-CMD-check

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

concurrency:
group: >
${{ github.workflow }}-${{ matrix.config.os }}-${{ matrix.config.r }})-
${{ github.event_name != 'pull_request' || github.run_id }}
cancel-in-progress: true

name: ${{ matrix.config.os }} (R-${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'release'}

env:
R_KEEP_PKG_SOURCE: yes
Expand All @@ -36,11 +48,9 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
extra-repositories: "https://mokymai.github.io/download/"


- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
Expand Down
43 changes: 15 additions & 28 deletions .github/workflows/drat--publish-package.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
on:
push:
branches:
- master
branches: [master, main]
workflow_dispatch:

name: Publish package
name: Publish package (drat)

jobs:
drat:
Expand All @@ -24,13 +24,13 @@ jobs:

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
SOURCE_REPO: ${{ github.repository }}
DEST_REPO: mokymai/download
TMP_DIR: tmp_dir
CACHE_VERSION: 1

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Info
run: |
Expand All @@ -39,33 +39,20 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true
extra-repositories: "https://mokymai.github.io/download/"

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Restore R package cache
# if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-${CACHE_VERSION}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-${CACHE_VERSION}-

- name: Install dependencies
shell: Rscript {0}
run: |
remotes::install_cran(c("roxygen2", "devtools", "drat"))
remotes::install_deps(dependencies = TRUE)
cache-version: 1
extra-packages: |
roxygen2
devtools
drat

- name: Roxygenize
shell: Rscript {0}
run: |
roxygen2::roxygenize()

run: roxygen2::roxygenize()

- name: Build source package
if: runner.os == 'Windows' && matrix.config.r == 'release'
Expand All @@ -91,7 +78,7 @@ jobs:
TOKEN: ${{ secrets.DEPLOY_DRAT_TOKEN }}

- name: Git clone DEST_REPO
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ env.DEST_REPO }} # 'mokymai/download'
ref: 'master'
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master, devel]
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: Update website
name: Update website (pkgdown)

jobs:
pkgdown:
Expand All @@ -15,16 +17,17 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

permissions:
contents: write
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: "release"
use-public-rspm: true
r-version: 'release'
extra-repositories: "https://mokymai.github.io/download/"

- uses: r-lib/actions/setup-r-dependencies@v2
Expand Down Expand Up @@ -62,7 +65,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@4.1.4
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: false
branch: gh-pages
Expand Down
10 changes: 4 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: bio
Type: Package
Title: Resources Manager for BS-2023
Version: 0.2.2.1
Date: 2023-04-23
Version: 0.2.2.2
Date: 2023-08-08
Authors@R:
person("Vilmantas", "Gegzna", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-9500-5167"),
Expand All @@ -22,7 +22,7 @@ RoxygenNote: 7.2.3
Additional_repositories:
https://mokymai.github.io/download/
Imports:
backup.tools (>= 0.0.1),
backup.tools,
checkmate,
clipr,
crayon,
Expand All @@ -37,12 +37,10 @@ Imports:
purrr,
quarto,
readr (>= 2.0.0),
rematch2,
remotes,
rlang,
rstudioapi (>= 0.13),
snippets (>= 0.0.9),
stringi,
snippets,
stringr,
styler,
tibble (>= 3.1.4),
Expand Down
10 changes: 2 additions & 8 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export(check_updates_pkg_bio)
export(check_updates_rcmdr_biostat)
export(check_user_info)
export(compare_version)
export(emokymai_browse_assingment)
export(emokymai_submit_assingment)
export(get_last_pkgs_installation_status)
export(get_os_type)
export(get_path_desktop)
Expand Down Expand Up @@ -46,23 +44,18 @@ export(open_rstudio_snippets_dir)
export(open_rstudio_system_dictionaries_dir)
export(open_rstudio_user_dictionaries_dir)
export(open_user_proj_list)
export(pkg_list_archived_versions)
export(read_projects)
export(restart_r)
export(restart_rstudio)
export(rstudio_compare_user_settings)
export(rstudio_delete_spellcheck_dictionaries)
export(rstudio_download_spellcheck_dictionaries)
export(rstudio_install_spellcheck_dictionaries)
export(rstudio_install_spellcheck_dictionary_lt)
export(rstudio_reload_ui)
export(rstudio_reset_keybindings)
export(rstudio_reset_user_settings)
export(rstudio_restart_r)
export(to_ascii_lower)
export(u_check_filename)
export(u_create_filename)
export(u_parse_filename)
export(u_prepare_assignment_dc)
export(update_pkg_bio)
export(update_pkg_rcmdr_biostat)
export(update_pkg_snippets)
Expand All @@ -82,6 +75,7 @@ importFrom(magrittr,"%>%")
importFrom(rlang,.data)
importFrom(snippets,get_path_rstudio_snippets_dir)
importFrom(snippets,open_rstudio_snippets_dir)
importFrom(stats,na.omit)
importFrom(stats,setNames)
importFrom(usethis,ui_code)
importFrom(usethis,ui_done)
Expand Down
8 changes: 1 addition & 7 deletions R/dictionaries.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ open_rstudio_internal_dictionaries_dir <- function() {
#' @description
#' - `rstudio_download_spellcheck_dictionaries()`
#' downloads and updates RStudio (system) spellchecking dictionaries.
#' - `rstudio_download_spellcheck_dictionaries_lt()`
#' installs improved Lithuanian spellchecking dictionary.
#' - `rstudio_delete_spellcheck_dictionaries()`
#' deletes RStudio (system) spellchecking dictionaries.
#'
Expand All @@ -92,7 +90,6 @@ open_rstudio_internal_dictionaries_dir <- function() {
#' \dontrun{\donttest{
#' rstudio_delete_spellcheck_dictionaries()
#' rstudio_download_spellcheck_dictionaries()
#' rstudio_install_spellcheck_dictionary_lt()
#' }}

rstudio_install_spellcheck_dictionaries <- function(secure = TRUE) {
Expand All @@ -109,10 +106,7 @@ rstudio_install_spellcheck_dictionaries <- function(secure = TRUE) {
rstudio_download_spellcheck_dictionaries <- rstudio_install_spellcheck_dictionaries

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#' @name spelling
#' @export
#' @concept r and rstudio settings
#' @concept dictionaries

rstudio_install_spellcheck_dictionary_lt <- function() {

tryCatch({
Expand Down
4 changes: 2 additions & 2 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ get_upgrade_str <- function(upgrade) {
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ui_msg_restart_rstudio <- function() {
usethis::ui_todo(paste0(
"To take effect, {underline('RStudio')} should be ",
"{underline('closed and reopened')}."
"To apply all changes, {underline('close and reopen')} ",
"{underline('RStudio')}."
))
}
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
42 changes: 42 additions & 0 deletions R/packages--check.R
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,48 @@ get_pkgs_cran_details <- function(repos = NULL) {
cran_all
}

#' Get previous package versions available on CRAN
#'
#' Function to scrape the CRAN website and retrieve archived (old) package versions
#'
#' @param package (character)
#' Package name.
#'
#' @return Vector with version numbers (the current version is not present).
#' @export
#'
#' @importFrom stats na.omit
#'
#' @examples
#' pkg_list_archived_versions("ggplot2")
#'
#' pkg_list_archived_versions("none")
pkg_list_archived_versions <- function(package) {

# Base URL of archived packages on CRAN
url <- "https://cran.r-project.org/src/contrib/Archive/"

# Create the complete URL for the package
package_url <- paste0(url, package)

# Extract the webpage table rows containing the package versions
rows <- try(
suppressWarnings(readLines(package_url, warn = FALSE)),
silent = TRUE
)

if (inherits(rows, "try-error")) {
return(as.numeric_version(NULL))
}

# Extract the archived versions
rows |>
stringr::str_extract(stringr::str_glue("{package}_(.*?)[.]tar[.]gz"), 1) |>
na.omit() |>
as.numeric_version() |>
sort(decreasing = TRUE)
}

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#' Get Details About Non-CRAN Package Installation
#'
Expand Down
2 changes: 1 addition & 1 deletion R/settings.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ restriction_status <- function(ignore_ip = getOption("bio.ignore_ip", FALSE),
#' 1) Resets RStudio state and user preferences (incl. color scheme)
#' 2) Clears function history, plot history, console, recent project list, etc.
#' 3) Closes unnecessary windows
#' 4) Resets custom keybindings to "bio-default"
#' 4) Resets custom key bindings to "bio-default"
#' 5) Resets R Markdown and R snippets to defaults in package "snippets"
#' 6) Creates folder "~/R/darbinis" and starts using it as working directory
#' when no project is used.
Expand Down
Loading