Skip to content

Commit

Permalink
Merge pull request #725 from mercycorps/transporter-3.0.0
Browse files Browse the repository at this point in the history
Transporter 3.0.0
  • Loading branch information
axoplasm authored Nov 1, 2022
2 parents e2efadc + 21504cb commit 1252f1f
Show file tree
Hide file tree
Showing 112 changed files with 14,883 additions and 6,666 deletions.
100 changes: 61 additions & 39 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,65 +1,87 @@
# OS generated files
####################
.DS_Store

# Log files
###########
*.log
login.log.*
*.pot
*.pyc
# Python bytecode:
*.py[co]

# Packaging files:
*.egg*
error.log

# Editor temp files:
# Editor configuration & temp files
###################################
.idea/
.vscode/
.nova/
*.swp
*.swo
*~
.eslintrc.yml

# SQLite3 database files:
*.db
# Python Temp files
###################
*.py[co]
*.pyc
__pycache__

# Logs:
*.log
# Python packages
#################
*.egg* # unused?

#allvritualenv
# Local database
################
*.db

# Virtual environments
######################
.env/
venv/
venv-ta/
.vagrant # unused?

# Non-production config & secrets
#################################
conf
conf/awstats.conf

#Misc.
.idea/
.vscode/
.DS_Store
media/
client_secrets.json
tola/settings/local_secret.py
*.crt
*.key
error.log
*.secret
settings.secret.yml
assets/
templates/links.html
coverage_html
.coverage
coverage/
tola/settings/test_local.py
log_convert_lop_to_numeric
*.key
*.secret
*.crt

# SASS Source Map
*.css.map
# Django collected static files
###############################
media/

# node modules
# Frontend assets
#################
node_modules

*.css.map
webpack-stats-local.json
webpack-stats-vagrant.json
.vagrant
site.retry
.eslintrc.yml
requirements.txt
htmlcov
webpack-stats-vagrant.json # unused?

# ingore temp files in bulk import dir, which will always start with yyyymmdd
# temp files in bulk import dir, which will always start with yyyymmdd
######################################################################
indicators/bulk_import_files/[0-9]*

# Are we sure we want to ignore these?
######################################
requirements.txt

# Probably related to automated tests we no longer use
######################################################
coverage_html
.coverage
coverage/
htmlcov

# ??? #
#######
assets/
templates/links.html
log_convert_lop_to_numeric
site.retry # ansible?

23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $ mysql --version

At the Terminal command line, run the following commands to install:
```bash
$ brew install python@3
$ brew install python@3.8
$ brew install mysql@5.7
```

Expand All @@ -62,15 +62,34 @@ export LDFLAGS="-L/usr/local/opt/mysql@5.7/lib"
export CPPFLAGS="-I/usr/local/opt/mysql@5.7/include"
```

For __macOS with ARM chip__ add this instead:
```text
export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"
export LIBRARY_PATH="/opt/homebrew/opt/openssl@1.1/lib/:$LIBRARY_PATH"
export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"
export PATH="/opt/homebrew/opt/mysql-client@5.7/bin:$PATH"
export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql-client@5.7/lib/pkgconfig"
export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib"
export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"
```

Back at the command line:
```bash
$ source ~/.bash_profile # if using bash, e.g on MacOS 10.14 or older
$ source ~/.zshrc # if using zsh, e.g. on MacOS 10.15 or newer
$ brew install mysql-client
$ brew install mysql-client
$ brew install py2cairo pango
$ pip3 install virtualenv
```

For __macOS ARM chip__ add this instead you might have to specify the mysql_client version:
```bash
$ brew install mysql-client@5.7
```

You should now also start the mysql server:
```bash
brew services start mysql@5.7
Expand Down
12 changes: 12 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
{
"loose": true
}
],
[
"@babel/plugin-proposal-private-methods",
{
"loose": true
}
],
[
"@babel/plugin-proposal-private-property-in-object",
{
"loose": true
}
]
],
"env": {
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.8
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile dev-requirements.in
Expand Down
9 changes: 9 additions & 0 deletions factories/indicators_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
Result,
ExternalService,
ReportingFrequency,
IDAAOutcomeTheme,
Indicator,
IndicatorType,
Level,
Expand Down Expand Up @@ -383,3 +384,11 @@ class Meta:

name = Faker('text')
is_active = True


class IDAAOutcomeThemeFactory(DjangoModelFactory):
class Meta:
model = IDAAOutcomeTheme

name = Sequence(lambda n: f'IDAAOutcometheme {n}')
is_active = True
27 changes: 25 additions & 2 deletions factories/workflow_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from factories.django_models import UserFactory, UserOnlyFactory
from workflow.models import (
Country,
IDAASector,
Organization,
ProfileType,
Sector,
Expand All @@ -28,6 +29,8 @@
Program,
CountryAccess,
ProgramAccess,
IDAASector,
GaitID,
PROGRAM_ROLE_CHOICES,
COUNTRY_ROLE_CHOICES
)
Expand Down Expand Up @@ -123,10 +126,18 @@ def password(obj, create, extracted, **kwargs):
obj.user.save()


class GaitIDFactory(DjangoModelFactory):

class Meta:
model = GaitID
django_get_or_create = ('gaitid',)

gaitid = Sequence(lambda n: "%0030d" % n)


class ProgramFactory(DjangoModelFactory):
class Meta:
model = Program
django_get_or_create = ('gaitid',)

class Params:
active = True
Expand All @@ -138,7 +149,7 @@ class Params:
)

name = 'Health and Survival for Syrians in Affected Regions'
gaitid = Sequence(lambda n: "%0030d" % n)
gaitid = RelatedFactory(GaitIDFactory, factory_related_name='program')
country = RelatedFactory(CountryFactory, country='United States', code='US')
funding_status = LazyAttribute(lambda o: "funded" if o.active else "Inactive")
_using_results_framework = Program.RF_ALWAYS
Expand Down Expand Up @@ -177,11 +188,16 @@ class Params:
age = False

name = Faker('company')
gaitid = RelatedFactory(GaitIDFactory, factory_related_name='program')
funding_status = LazyAttribute(lambda o: "Funded" if o.active else "Inactive")
_using_results_framework = LazyAttribute(
lambda o: Program.RF_ALWAYS if o.migrated is None else Program.MIGRATED if o.migrated else Program.NOT_MIGRATED
)

@post_generation
def gaitid(self, create, extracted, **kwargs):
GaitIDFactory(gaitid='123456', program=self)

@lazy_attribute
def reporting_period_start(self):
year = datetime.date.today().year
Expand Down Expand Up @@ -341,6 +357,13 @@ class Meta:
sector = Sequence(lambda n: 'Sector {0}'.format(n))


class IDAASectorFactory(DjangoModelFactory):
class Meta:
model = IDAASector

sector = Sequence(lambda n: f'Sector {n}')


class ProfileType(DjangoModelFactory):
class Meta:
model = ProfileType
Expand Down
Loading

0 comments on commit 1252f1f

Please sign in to comment.