Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Merge branch 'cookiecutter-template' into update-from-cookiecutter-20…
Browse files Browse the repository at this point in the history
…22-10-11-2027
  • Loading branch information
apiology committed Oct 12, 2022
2 parents 8707f26 + 9a1fb7f commit a204ae8
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 13 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ commands:
jobs:
overcommit:
working_directory: ~/op-env
docker:
- image: apiology/circleci-python:latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions .markdownlint_style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# frozen_string_literal: true

rule 'MD029', style: 'ordered'
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style ".markdownlint_style.rb"
2 changes: 0 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Related backlog tasks:

* Do release of cookiecutter-pypackage projects in CircleCI (after other tests pass)

First, make sure version has been bumped:

```sh
git checkout main
git pull
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ source 'https://rubygems.org'
# magit doesn't seem to want to use the bundled version at the moment,
# so let's favor the more recent version...
gem 'overcommit', ['>=0.58.0']

gem 'mdl'
22 changes: 21 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
GEM
remote: https://rubygems.org/
specs:
chef-utils (17.10.0)
concurrent-ruby
childprocess (4.0.0)
concurrent-ruby (1.1.10)
iniparse (1.5.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
mdl (0.11.0)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.1)
mixlib-cli (~> 2.1, >= 2.1.1)
mixlib-config (>= 2.2.1, < 4)
mixlib-shellout
mixlib-cli (2.1.8)
mixlib-config (3.0.27)
tomlrb
mixlib-shellout (3.2.7)
chef-utils
overcommit (0.58.0)
childprocess (>= 0.6.3, < 5)
iniparse (~> 1.4)
rexml (~> 3.2)
rexml (3.2.5)
tomlrb (2.0.3)

PLATFORMS
ruby
x86_64-darwin-20
x86_64-linux

DEPENDENCIES
mdl
overcommit (>= 0.58.0)

BUNDLED WITH
2.2.3
2.2.33
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ servedocs: docs ## compile the docs watching for changes
release: dist ## package and upload a release
set -e; \
new_version=$$(python3 setup.py --version); \
twine upload -u $$(with-op op get item 'PyPI - test' --fields username) -p $$(with-op op get item 'PyPI - test' --fields password) dist/op-env-$${new_version:?}.tar.gz -r testpypi; \
twine upload -u $$(with-op op get item 'PyPI' --fields username) -p $$(with-op op get item 'PyPI' --fields password) dist/op-env-$${new_version:?}.tar.gz -r pypi
twine upload -u __token__ -p $$(with-op op item get 'PyPI - test' --fields api_key) dist/op-env-$${new_version:?}.tar.gz -r testpypi; \
twine upload -u __token__ -p $$(with-op op item get 'PyPI' --fields api_key) dist/op-env-$${new_version:?}.tar.gz -r pypi

dist: clean ## builds source and wheel package
python setup.py sdist
Expand Down
29 changes: 23 additions & 6 deletions fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,18 @@ ensure_rbenv() {

latest_ruby_version() {
major_minor=${1}
rbenv install --list 2>/dev/null | grep "^${major_minor}."

# Double check that this command doesn't error out under -e
rbenv install --list >/dev/null 2>&1

# not sure why, but 'rbenv install --list' below exits with error code
# 1...after providing the same output the previous line gave when it
# exited with error code 0.
#
# https://github.com/rbenv/rbenv/issues/1441
set +e
rbenv install --list 2>/dev/null | cat | grep "^${major_minor}."
set -e
}

ensure_dev_library() {
Expand All @@ -91,9 +102,17 @@ ensure_ruby_build_requirements() {
ensure_dev_library openssl/ssl.h openssl libssl-dev
}

ensure_latest_ruby_build_definitions() {
ensure_rbenv

git -C "$(rbenv root)"/plugins/ruby-build pull
}

# You can find out which feature versions are still supported / have
# been release here: https://www.ruby-lang.org/en/downloads/
ensure_ruby_versions() {
ensure_latest_ruby_build_definitions

# You can find out which feature versions are still supported / have
# been release here: https://www.ruby-lang.org/en/downloads/
ruby_versions="$(latest_ruby_version 3.0)"
Expand Down Expand Up @@ -302,12 +321,12 @@ ensure_pyenv_virtualenvs() {
}

ensure_pip_and_wheel() {
# Make sure we have a pip with the 20.3 resolver, and after the
# initial bugfix release
# pip 22 seems to be better at finding pandas pre-compiled wheels
# for macOS, so let's make sure we're using at least that version
major_pip_version=$(pip --version | cut -d' ' -f2 | cut -d '.' -f 1)
if [[ major_pip_version -lt 21 ]]
then
pip install 'pip>=20.3.1'
pip install 'pip>=22'
fi
# wheel is helpful for being able to cache long package builds
pip show wheel >/dev/null 2>&1 || pip install wheel
Expand Down Expand Up @@ -359,8 +378,6 @@ ensure_overcommit() {
fi
}

ensure_rbenv

ensure_ruby_versions

set_ruby_local_version
Expand Down
4 changes: 2 additions & 2 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ coverage==5.5
Sphinx==4.3.1
twine==3.4.1
pytest==6.2.4
mypy==0.910
mypy==0.931
types-PyYAML==6.0.0
# lxml is needed for mypy coverage reporting:
#
# You must install the lxml package before you can run mypy with `--html-report`.
# You can do this with `python3 -m pip install lxml`.
lxml==4.6.5
lxml==4.9.1
yamllint==1.26.1

0 comments on commit a204ae8

Please sign in to comment.